Add AppleScript script to contextual menu's Services via Automator

Greetings!

My goal is to include an AppleScript script in the contextual menu’s Services menu via an Automator workflow.

The script functions flawlessly when tested in Script Editor and when accessed from the menubar’s Script Menu.

I included the script in an Automator workflow and it functions flawlessly when tested in Automator.

on run {input, parameters}
tell application “System Events”
keystroke tab using control down
end tell
return input
end run

I confirm that the saved workflow is in user/Library/Services.

However, the workflow is missing from the Services menu in the contextual menu.

What do I need to do so that the workflow displays in the Services contextual menu and functions properly?

Many thanks in advance!

Are you creating it as a Quick Action? Also, if you are not providing a context for it to match, it will show up under the main Services menu instead of the contextual one.

Thanks for your posting.

You’re correct; the workflow saved as a Quick Action and it is missing from the Quick Action and Services submenus.

What do I need to do so that the workflow displays in either submenu?

I had the same experience recently. After a few days I noticed that it did show up where it should. Just a bit slow…

For a Quick Action you get one or the other. If the workflow settings declare that it receives something (a context), then it shows up in the contextual menu, otherwise it will be in the main Services menu. Don’t forget to check the Services Settings to make sure the Quick Action is enabled.

Thanks again for your reply!

After rereading it, I finally saw the problem; the workflow’s configuration needed to have a specified input.

After configuring the workflow for files or folders as the input, the workflow then displayed in the Quick Actions submenu.

Many thanks! :slightly_smiling_face:

Thanks for your posting. Glad it was solved for you!

Even if it doesn’t have a specified input, the workflow should still appear in an application’s Services menu.

I recently (six weeks or so ago) created a tutorial that includes some details about Quick Actions and contextual menu items via Applescript and Automator related to this topic. I used to refer to Ben Waldie’s excellent instructions, but I added many details to my description because I couldn’t find his anymore.

The completed tutorial provides a contextual menu item to make it easier to eject local volumes, and I created it to provide a no cost alternative to the recently released “Jettison”. It’s a work in progress, so please make any suggestions for improvement that you’re willing to contribute. Thanks.

red_menace: Thanks for your posting; regrets for the delay in replying.

Yes, that’s what I expected. But it did not.

I changed the workflow’s configuration from files or folders as the input to text as the input, and now the workflow does appear in the Services submenu after I click on a text field.