22

Long-time ago i created a service in Automator, which still works. But i want to change the code and it isn't located in either /Library/Services/ nor ~/Library/Services/ as they are both empty

Have i lost the source code or can i restore it otherwise?

1
  • 1
    Strange... ~/Library/Services/ is the default location for new services created in Automator, and I just confirmed that myself by creating a new service.
    – Austin
    Commented May 12, 2011 at 23:29

9 Answers 9

24

As others have said, services are normally in one of the Library/Services folders (~/Library/Services, /Library/Services, and /System/Library/Services). If just looking there doesn't turn it up, another option is to spy on what files are being opened when you invoke the service, with something like:

sudo opensnoop -n WorkflowService

... and then running the service, and looking through the results to see if you can spot the relevant file. If it isn't an Automator-based service, you might have to leave off the -n WorkflowService (although you'll have a lot more irrelevant files to sort through because you'll be seeing every file anything in the entire OS opens).

4
  • sudo opensnoop -n WorkflowService didn't show anything at all and couldn't get any reasonable out of just sudo opensnoop
    – Tyilo
    Commented May 13, 2011 at 22:15
  • 1
    @Tyilo: I'm pretty sure that means it's not actually an Automator-based service. Might it be provided by an application you have installed? Commented May 14, 2011 at 1:24
  • You were right! I thought i made it myself... Thank you very much!
    – Tyilo
    Commented May 14, 2011 at 10:20
  • 1
    I have gained 10 experience points and hit +1 against buggy processes having now learned opensnoop
    – BaseZen
    Commented Mar 9, 2017 at 21:47
12

The location of the user created services is under:

~/Library/Services/

(tested Mac OS X Mountain Lion 10.8.4)

other locations you get by entering following command in Terminal:

mdfind .workflow
2
  • still the same on 10.9.5 and when in doubt the mdfind does it.
    – Ruskes
    Commented May 13, 2015 at 17:36
  • This was it for me on El Capitan. Note that /Users/<username>/Library is a hidden and/or system directory, so you'll need to activate the proper settings to display it in Finder.
    – Magnus
    Commented Dec 10, 2016 at 2:58
3

Did you try ~/Library/Workflows/?

2
  • Doesn't exist either and also tried /Library/Workflows/
    – Tyilo
    Commented May 12, 2011 at 22:31
  • This is precisely where I found mine, automator scripts created on Mavericks, but running Yosemite now.
    – Duncan
    Commented Apr 10, 2015 at 18:22
1

Try searching for .workflow in Spotlight to find all workflow files in your user folder. The service will be called Whatever the Service Name Is in the Services Menu.workflow.

If you prefer the Terminal, this command will do the same thing, searching the current directory and all the folders underneath it:

find ./ -name "*.workflow"

EDIT: Corrected a small mistake in the Terminal command. Apparently -type f doesn't work on .workflow files.

7
  • No result in Spotlight and the terminal command showed no results: 'tyilos-macbook:~ Tyilo$ cd / tyilos-macbook:/ Tyilo$ sudo find ./ -type f -name "*.workflow" Password: find: .//dev/fd/3: Not a directory find: .//dev/fd/4: Not a directory'
    – Tyilo
    Commented May 13, 2011 at 6:28
  • @Tyilo Sorry, there was a typo in the Terminal command that I corrected. Try it again, and if it doesn't find anything in your home directory (~), try running it from the system's root directory (i.e. enter cd / before running the find command). This will take a while, so be prepared to be patient.
    – Austin
    Commented May 13, 2011 at 6:40
  • @Tyilo And of course, you can search the root folder in the GUI by opening Macintosh HD in Finder and typing .workflow into the search box. (Check the File Name option instead of Contents for a faster search.) The only disadvantage of this is that it won't search in hidden or system folders, but you probably won't need it to anyway.
    – Austin
    Commented May 13, 2011 at 6:44
  • @Austin My file wasn't between the files using cd / and sudo find ./ -name "*.workflow" > ~/Desktop/services.txt. I found two other folders which also could be a possible location, but they didn't contain the file. The locations were /Library/Application Support/Apple/Automator/Workflows/ and /System/Library/Services/. I've uploaded the file here: cl.ly/6i1t
    – Tyilo
    Commented May 13, 2011 at 13:07
  • @Austin also tried with sudo find ./ -name "*" > ~/Desktop/all.txt and still no match
    – Tyilo
    Commented May 13, 2011 at 13:37
1

Edited to add

Automator services are definitely supposed to be stored in ~/Library/Services, based on my Googling. I just created a new service in Automator and it placed it there.


Perhaps ~/Library/Application Support/Automator/

Alternately, when I last made a service I believe that I had to save it as an .app first, so you might search for apps.

6
  • The /Library/Application Support/Automator/ folder didn't exist, but ~/Library/Application Support/Automator/ did and was empty -.-'
    – Tyilo
    Commented May 12, 2011 at 21:15
  • @Tyilo Sorry, that's what I meant. Fixed my answer, even if it's wrong. :) Commented May 12, 2011 at 22:19
  • @Matthew Frederick Found all app files using @Austin command, and none of them matched my service title
    – Tyilo
    Commented May 13, 2011 at 13:23
  • @Tyilo I just checked my system and realized that I'd created an AppleScript app that I then used Automator to turn into a service, hence my .app suggestion. As a result both .app and .scpt files existed for it. Unless you did the same, my suggestion is no help. Commented May 13, 2011 at 13:44
  • @Matthew Frederick Don't have the .scpt file of it :s, but the service file thingy must be somewhere, else it wouldn't work
    – Tyilo
    Commented May 13, 2011 at 17:12
1

The best way that I know to find workflows or anything else is to use the app: "EasyFind.app". Unlike the Finder and Spotlight and even the Unix command-line, EasyFind.app can be configured to search everywhere, and it has a Unix-style pattern-matching capability. For example "*.workflow" can be used to find any Service on your entire hard-drive.

Best of all EasyFind.app is free and legal.

EasyFind.app

Configuring EasyFind.app to find any Automator workflow (including services)

INSTEAD of using extra programs you can run your Terminal and enter command:

mdfind .workflow
3
  • Can you elaborate on where EasyFind is able to find stuff but /usr/bin/find isn't?
    – nohillside
    Commented Jun 30, 2013 at 5:37
  • @patrix I've been looking at /usr/bin/find again. I believe that it will work, it's just that EasyFind.app is easier to use.
    – Kaydell
    Commented Jun 30, 2013 at 21:44
  • 1
    @patrix: The following command works OK for me: find ~ -name ".workflow" better than find ./ -name ".workflow" which only searches the current directory. From the command-line, it is really /usr/bin/locate that I don't trust. It is faster, but the files have to be indexed before they can be found. Also, I don't trust Finder > Finder nor Spotlight to find everything because they don't open up application bundles or the ~/Library folder which is not invisible in Mountain Lion. So /usr/bin/find is OK, it's just that for me, I still prefer EasyFind.app because it's easier to use.
    – Kaydell
    Commented Jun 30, 2013 at 21:45
1

I had the same problem.

I found following ~/Library/Services/ does exist, on my 10.8 OSX.
But I can not see it with Finder, only from Terminal.

I aslo find this:
http://www.macworld.com/article/1161156/view_library_folder_in_lion.html
That explain it little better.

0

If the Services of workflow is generated by system, It will located in "/System/Library/Services".

But if you workflow(services) added by yourself from Automator, it will located in "/Users/[your username]/Library/Services".

0

It is a hidden folder:/Macintosh HD/Users/<username>/Library/Services. The best way to get there is either create a new service in automator and save it and follow steps below, or if you have one created already follow these steps:

  • Open System Preferences > Keyboard and click the Shortcut tab.
  • Find the service that you created
  • Right click on the service and Open in Finder.

It will reveal the hidden folder.

You must log in to answer this question.

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