Skip to content

MacVim can't communicate via AppleEvents due to missing security declaration in manifest #821

Closed

Description

@shayneholmes

Noticed an issue editing nvALT notes in MacVim (commented on ttscoff/nv#496), but the root cause seems to MacVim's declared security permissions.

This issue should affect other interprocess communication via AppleEvents, but I don't know of any others to test it with.

Preconditions:

  • Using MacOS Mojave
  • nvALT installed
  • nvALT has MacVim set as its external editor
  • nvALT is storing notes in a single database

Steps:

  1. Edit a note with external editor. (MacVim opens with the note's content.)
  2. Change the note and save.

Expected:

The note updates in nvALT.

Actual:

No update. Console shows these logs:

error	11:25:39.605395 -0800	tccd	Refusing TCCAccessRequestIndirect for service kTCCServiceAppleEvents and client /Applications/MacVim.app[0] without NSAppleEventsUsageDescription key
default	11:25:39.605565 -0800	nvALT	TCCAccessRequestIndirect_block_invoke: access request result was 0, timeout was 0
error	11:25:39.605914 -0800	nvALT	Since sending application [sess=xxx pid=xxx uid:x,x,x g:20,20 pV:xxx] is not permitted to send this AppleEvent to this process, returning an errAEEventNotPermitted reply.

Causes:

The error log mentions NSAppleEventsUsageDescription, and running through the steps above after placing that key in Info.plist results in a new dialog being shown:

image

After the user clicks "OK", the note updates as it should.

Activity

  1. changed the title [-]MacVim can't communicate via AppleEvents due to missing NSAppleEventsUsageDescription[/-] [+]MacVim can't communicate via AppleEvents due to missing security declaration in manifest[/+] on Dec 17, 2018
  2. added a commit that references this issue on Dec 17, 2018
    8818286
  3. ychin commented on Dec 18, 2018

    @ychin
    Member

    The fix looks fine, but let me look up this Mojave security change and test it out first.

    Also, how exactly does nvALT work? It's MacVim controlling nvALT using AppleScript? Is it just a series of :!osascript calls? I wasn't quite understanding how MacVim understands to send AppleScript calls to other applications.

  4. added this to the snapshot-154 milestone on Dec 18, 2018
  5. shayneholmes commented on Dec 18, 2018

    @shayneholmes
    ContributorAuthor

    Good question! Did some digging and found this:

    MacVim, when compiled with the odbeditor option (:h odbeditor has more), implements the ODB Editor Suite, which is a protocol for external editors based on Apple Events. nvALT uses that protocol to leverage MacVim as an external editor. After launch, MacVim uses Apple Events to notify nvALT when the file is modified or closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions