Question: How to run safari automator service?
I'm trying to run a Safari automator service, to close tabs to the right (like in Chrome). I found a webpage (https://redfinsolutions.com/blog/close-tabs-right-safari) with the following steps, which I've followed to the letter (I think), but I can't get the service to appear in the Safari -> Services list. Steps below:
- Open Automator on your Mac, and create a new "service."
- For actions to run, choose "Run AppleScript," and enter the following AppleScript:
- Once you have that, save it - I named mine "close-right" (and I saved it to my iCloud, but I think you can put it anywhere).
- Now, one option is to show the script editor dropdown in your toolbar, and choose the script from there, but I've already got enough stuff there, so I'm just going to set up a keyboard shortcut for it instead. Open up "System Preferences" on your Mac, then pick "Keyboard."
- Here, you should select "App Shortcuts" and add a new shortcut for the "Safari" application. When asked about the menu item, you need to use the exact text that appears under Safari > Services for your new service (it should be the filename, like "close-right").
- Assign a keyboard shortcut (I used Command-Shift-Z).
- Now in Safari, when you press Command-Shift-Z, it closes tabs to the right of the one you're looking at!
The script does it's job when it runs, it's just the part of getting it to run outside of automator. I think the problem is in automator where it says "Service receives selected" and there's the drop-down list of options, which the guide fails to state what option it should be. The option after that list is "in" and the author later said that that option had to be "Safari.app", which I've selected.
For the "Service received selected" option, if say I select the option "text", then I can get the service to appear in Safari -> Services when I select some text on a given webpage, and then the service runs no problem (including the keyboard shortcut). Obviously though, I don't want to have to select some text every time I want to close the tabs to the right. I've tried the "web content" and "no input" options, but they still don't make the service appear in the Safari menu.
Any help would be greatly appreciated!