6

I know next to nothing about the OS X, but I've been asked to make a few different scripts for actions in Apple Mail. One is to bind a hotkey that will create a reminder with a followup time of two business days.

I followed a guide on how to build the script and insert it into Automator found here. The script works when running in the AppleScript application, and compiles and runs in Automator. The service/workflow generated by Automator is saved to ~/Library/Services/ but does not show in the services menu in Apple Mail. This article says that services for Apple Mail should be in the /System/Library/Automator folder. I am unable to move the service to that folder as the folder is locked. The service is set to have no input, and be in the mail application.

How can I get this workflow/service to show in the mac mail services menu?

3

So, apparently, I had to disable rootless system integrity protection just to move the workflow file between folders. I still hope someone finds a better way of installing services in the mail app in El Capitan, because having to do multiple reboots and disabling low level security features seems excessive when I'm just trying to pull data from two basic apps.

http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/

| improve this answer | |
  • I don't think you have to put services inside the /System/ tree. Generally, system items go there, not user items. I think that's why it's locked down. I just recreated the service (but didn't put in the applescript code), and found an empty shortcut and assigned it. The service ended up in the 'General' category but it is available while Mail is active and the shortcut triggers the script. Engadget's article actually states that Apple puts its services in the System tree, but users' go elsewhere. You might try without the keyboard shortcut you've chosen — that's a pretty widespread one. – Mockman Aug 30 '18 at 0:15
3

Depending on how your script is configured, by default, any Service requires to have an item selected / highlighted (in your case, an email) as they are context sensitive.
You can disable this behaviour by changing the drop down field "Service receives" and selecting "no input". This obviously only applies if your script fetches input itself or doesn't need it.

Selecting no input allows for the service to run without the need to select an item

Unfortunately there do seem to be weird issues when services have spaces and/or numbers in their name.
As stated by @gerlos, renaming them should solve the problem, but a reboot might be required (Which was the case for me).

As an extra;
If you're now finding that you don't like the name of the new service, you can change it!
Just right click the .workflow file and select 'show package contents'.
Inside you'll find a configurable info.plist file.
Open it up with your favourite text or plist editor (Or just plain old TextEdit) and look for the xml key 'NSMenuItem', it should contain a key entry 'default' associated with a string, the string in question is the service's display name.

More information on everything that's configurable (e.g. a service description) can be found in the apple documentation here: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/SysServices/Articles/properties.html

Tested on OS X High Sierra

| improve this answer | |
  • I have 42 services with spaces in their name and every last one of them shows on the Services menu. I'm using US English and one should not have to rename without spaces using US English, however I will submit that in a different language it may be an issue as gerlos said he's using Italian. – user3439894 Feb 29 at 14:41
  • It would be rather silly if localisation causes the problem, but mine is set to be English (UK), so you might be right. I tried flushing the pboard with "pbs -flush -update", manually modifying the cache, but to no avail, a rename was required. – AG_Alex2097 Mar 1 at 13:25
  • The "no input" thing worked for me. My Service took input from my clipboard contents… which I guess was implying the wrong context for making the service available. Dunno. Anyway, changing to "no input" did the trick. – Sam May 27 at 12:38
0

I stumbled upon this very problem recently, on MacOS 10.11 El Capitan and MacOS 10.14 Mojave.

I created a service in Automator, it automatically saved it in ~/Library/Services/ but didn't appear in services menu as I expected.

The issue seems to be related to the file name of the workflow file (perhaps spaces in file name). In my experience, it should be enough to rename the file to solve the problem.

To do so, go to ~/Library/Services/ (from Finder menu: Go > Go to folder and paste ~/Library/Services/ there) and rename the service file, removing spaces from file name.

Then you may need to go to Keyboard pane in Mac Preferences, and enable your service in the shortcut tab (look in the "Services" section).

| improve this answer | |
  • RE: removing spaces from file name, I have lots of Automator Services/Quick Actions with spaces in their names and they show just fine. Suggesting one remove spaces is ridiculous! – user3439894 Oct 9 '19 at 16:43
  • @user3439894 seems ridiculous to me too. Nevertheless, I faced the same problem of the OP a few times, and renaming the file removing space helped me. I'd like to know if this works for someone else too or not. Perhaps is related to the localization of the system? Mine is Italian. – gerlos Oct 13 '19 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .