I am new to Alfred and am running into a problem. I created an AppleScript to send information from Outlook 2016 to OmniFocus 2. I have it set to run an external script (makes it much easier for me to make changes and test). I created a hotkey to run the script. When I launch the script with the hotkey, I get this error:
Unable
to run task
!
Reason
:
launch path not accessible
The
external script may not exist
,
or does not have execute
(+
x
)
permissions
.
I have tried putting in the script folder for OmniFocus, Outlook and Alfred, but get the error each time. I am sure I a doing something simple wrong. Thanks in advance for your help!
If you set the preference in Alfred to "Run AppleScripts instead of opening" (found in: "Alfred Preferences -> File Search -> Advanced -> AppleScripts [ ] Run AppleScripts instead of opening), then when you search and open an AppleScript file in Alfred then Alfred will run it directly. So, no need to create a script for that. Just use a Hotkey trigger connected to an Open File action (where you can directly drag and drop the AppleScript that you want to run).
Fortunately, Apple has written a bunch of programs to access the Cool Apple Shit from the underlying UNIX layer. As
@GuiB
explained, the one you need to run AppleScript scripts from the UNIX layer is
osascript
. But there are other super-cool ones, like
security
, which provides access to the macOS Keychain, and
mdfind
, which lets you run Spotlight queries from the command line/scripts/workflows.