2

I added a script which works when I run it from Automator. It's the script in this post: How to fade out/in in iTunes?.

But I cannot get any keyboard shortcuts to trigger it. In iTunes, when I hit the assigned keyboard shortcut for it, I just hear the "thud" sound I associate with an inappropriate keystroke. (I've tried setting parameters in Automator: "Service receives selected [text/no input]" and "in [any application/iTunes]" and more... No dice.)

Thanks for any light!

5
  • Did you make it into a Service then add the key commands to that Service? Recently it appears you need to save then reload an automator action before the OS will offer for you to make it an actual Service.
    – Tetsujin
    Commented Feb 13, 2017 at 15:29
  • In Automator, I created it as a Service; when done (and having tested that it works running it from within Automator), I set the keystrokes under System Preferences > Keyboard > Shortcuts > Services > [what I named it]... When I use the keystroke, nothing happens. By the way, I also made Automator able to "control my computer" under System Preferences > Security & Privacy > Accessibility > + Automator. Just in case. (It seems not to have mattered.) I'm not sure what you mean by "you need to reload an automator action"; but I have shut Automator down and reopened it several times.
    – Brendan
    Commented Feb 13, 2017 at 19:00
  • @Brendan, What keyboard shortcut did you assign the Automator created Service? Also, try triggering the Service from the Applications Services menu and then try the keyboard shortcut, does it work then? Commented Feb 13, 2017 at 20:08
  • @user3439894, I assigned a few different keystrokes, but settled on CTRL-Opt-Command-F. Even when I set the "Services receive selected [text] in [iTunes]," the iTunes Service menu just shows a greyed-out "No services apply." (Thanks for the replies! I must be doing something simple wrong.)
    – Brendan
    Commented Feb 13, 2017 at 22:56
  • Thanks, everyone. While I don't know what I had misconfigured, @Monomeeth's steps solved my problem: The service runs from any app Services menu, and the keystroke works, too!
    – Brendan
    Commented Feb 15, 2017 at 11:26

1 Answer 1

1

Just to cover all bases, I thought I would go through the process you would need to go through in order for this to work. That way you can just do it from scratch and hopefully correct wherever you've gone wrong (or, if it still doesn't work, at least eliminate an error on your behalf as the cause).

In summary you will need to use:

  • Automator to create a service that runs an Apple Script
  • System Preferences to assign a keyboard shortcut to the service

Below are the steps involved for each.

1. Create a service using Automator

  1. Launch Automator (usually found within your Applications folder)
  2. Go to File > New.
  3. Select Service and click Choose.
  4. In the top right hand of the window that appears, ensure that "No input" is selected from the Service receives drop-down list.
  5. Ensure the In drop-down list is showing "Any application".
  6. In the second column containing the long list, find "Run AppleScript" and double-click on it.
  7. This will add the Run AppleScript window on the right.
  8. Now, replace the ( Your script goes here ) with the script you want (taken from the question you reference)
  9. Save the service using a meaningful name (e.g. iTunesFade).

Now to the next step.

2. Creating your shortcut

  1. Go to System Preferences > Keyboard > Shortcuts.
  2. Select Services from the sidebar.
  3. Find your service (it'll be in the list on the right-hand side).
  4. Add a shortcut by double clicking on the service name.
  5. Now go to System Preferences > Security & Privacy > Privacy.
  6. Select Accessibility in the sidebar.
  7. Click on the + sign (you may need to unlock the padlock if it's locked).
  8. Add Automator.
  9. Add Finder (to find this you will need to navigate to /System/Library/CoreServices/Finder.app).
  10. Exit your System Preferences.

Now you should be able to do two things:

1. Run the service from any application by going to the Services list within any Application menu (e.g. Finder > Services, Safari > Services, Mail > Services, etc) and select the service you just created. If iTunes is running, the service will fade iTunes in/out

2. Use the keyboard shortcut to run the service.

NOTE: I am aware that for some users keyboard shortcuts do not seem to work even though they've been assigned to a service. This is a whole other topic, but if this happens in your case, at least you can run the service from within any application you're using.

Let me know how you go.

2
  • Thanks, @Monomeeth! Your steps helped me iron out my whatever I had misconfigured. I appreciate your thoroughness (wow) - it worked!: The service runs from any app Services menu now, and the keyboard shortcut works, too!
    – Brendan
    Commented Feb 15, 2017 at 11:27
  • Side note, I was just trying too do exactly this (global shortcut for a service) and discovered that it would not work in a Java app, because there is nothing in the Services menu. I guess services aren't available to Java? I don't know for certain, but for whatever it's worth I had to go another route and assigned the macro (typing today's date and current time) & shortcut via BetterTouchTool which works perfectly absolutely everywhere and didn't even require Automator.
    – JVC
    Commented Jul 3, 2018 at 19:07

You must log in to answer this question.

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