Jump to content
fort

AppleScript for triggering System commands

Recommended Posts

Is there any way to trigger Alfred "System" commands via AppleScript, e.g., ejectall, lock, and so on? I'd like something like the following, but without having to specify a workflow

tell application "Alfred 2" to run trigger "foo" in workflow "test.workflow.com"

or to be able to specify that it's one of the commands in the System list.

 

Thanks.

Share this post


Link to post

Is there any way to trigger Alfred "System" commands via AppleScript, e.g., ejectall, lock, and so on? I'd like something like the following, but without having to specify a workflow

tell application "Alfred 2" to run trigger "foo" in workflow "test.workflow.com"

or to be able to specify that it's one of the commands in the System list.

 

Thanks.

 

You could just create multiple external triggers in a workflow that connect to each of the Action->System Commands items and then use AppleScript to access those triggers. Is that what you're asking for?

Share this post


Link to post

That would work, but I was actually hoping for something simpler: a way to directly trigger Alfred's System keywords via AppleScript.

 

I'm assuming there's no way to do that, so I'll create the workflow you suggest instead. Thanks!

Share this post


Link to post

Take a look at External triggers. Also see a similar thread.

 

AFAICT, those are relevant to triggering actions in workflows, not System commands directly. Anyway, I managed to get things working by setting up external triggers to system commands in a workflow like the one David suggsted, and then calling those via AppleScript.

 

Thanks!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...