Previous 1 2 Next 24 Replies Latest reply: May 29, 2015 2:15 PM by 7stud
Gerben Wierda Level 1 (135 points)

I have created my first Automator workflow. Pretty simple, I have used the PDF to image action. Now, this works, but the file is saved somewhere in /var/folders. What I want is a service that takes the selected PDF files and renders them to JPEG at a certain dpi and quality (so far so good) but that then saves it next to the PDF file already there. I tried getting tthe filename and using that in a follow-up action, but that hasn't worked. I can get the rendered image file in a mail message and I can see it ending up in /var/folders when I just use the PDF to image action.


But I can't find an action or combination of actions that gets me the result file in the right location (same as source).


Can someone help?

  • Gerben Wierda Level 1 (135 points)

    Nobody?? It can't be done? No Apple Genius who knows this?

  • Frank Caggiano Level 7 (25,715 points)

    If you posted your workflow it would be easier to try to help. Guessing at what you are doing isn't going to be of much help.



  • Gerben Wierda Level 1 (135 points)

    OK, thanks for wanting to help. I thought I had posted my workflow. It is a Service Workflow that consists of one single Library Action: from the PDFs Actions I have the Action "Render PDF Pages as Images". What this action does is create jpeg files. If I select the file Foo.pdf in Finder and select the service, I end up with Foo.jpeg in a temporary directory somewhere in /var/folders.


    If you mean something different by 'posting my workflow', please tell me what you mean. I can post the XML in the document.wflow inside the Contents of the .workflow bundle (but that is just a standard Automator Library action)

  • Frank Caggiano Level 7 (25,715 points)

    By posting the workflow I meant to post a screen capture of the workflow open in Automator. Just makes it easier and less prone to error if we can see what you have actually done.


    But I think in your case try adding a Move Finder Items after the Render PDF Pages as Images. That should allow you to put the files where you like.


    Screen Shot 2012-08-18 at 08.08.58.png


    Post back if that isn;t what you are looking to do.



  • Gerben Wierda Level 1 (135 points)

    Thanks & yes that I what I am doing. I looked at that Move Finder Item Action. But that only gives me the possibility to put it somewhere static and specific. I want the resulting JPEG to end up next to the PDF I have rendered. I do not want all of them to end up together in one big heap in a single location.


    So what I have been trying to find is a way to find out the directory part of the file path sent to this service, then use that directory part of the file path as the target for Move Finder Item.

  • pjdube Level 3 (830 points)

    I can help you with this, but please post what you have worked out so far as Frank says. It will make it easier for us to see what exactly you are trying to accomplish and where we can help.

  • Gerben Wierda Level 1 (135 points)

    Two step workflow now (as depicted above by Frank):


    Service receives selected PDF files in

    1. Render PDF Pages as Images

    2. Move Finder Items (replace existing) to a fixed folder on my Desktop


    But what I'd really like is if the JPEG renders would end up next to the original PDF files in the directory where the PDF file came from. I have been trying a few things, but none of these have worked. So, the JPEG files keep up ending in that same target folder.


    What I want to do (but don't know how in Automator)


    1. From a selected PDF file in Finder, split the full path into folder, basename,'.pdf'

    2. Create folder/basename.jpeg from folder/basename.pdf

  • pjdube Level 3 (830 points)

    I am still confused with what you want exactly, But I think you should start with this. This will make images of the PDF and file it in the parent folder of where you got the PDF from.


    Screen Shot 2013-03-31 at 6.01.48 PM.JPG

    Screen Shot 2013-03-31 at 6.02.02 PM.JPG

  • Gerben Wierda Level 1 (135 points)

    That looks indeed like what I want. But where is the "Get Parent Folder" action? I can't find it in my Automator (10.7.5).

  • Gerben Wierda Level 1 (135 points)

    I found this as AppleScript in the forums


    on run {input, parameters}
    set pathList to {}
    repeat with itemNum from 1 to count of input
    tell application "System Events"
    copy POSIX path of (container of (item itemNum of input)) to end of pathList
    end tell
    end repeat
    return pathList
    end run


    But how do I get that into an action?

  • pjdube Level 3 (830 points)

    Get Parent Folder is a 3rd party action.


    You can download it here:

  • pjdube Level 3 (830 points)

    Did this help you? Otherwise I will try to find another way to go about it and post back.

  • Gerben Wierda Level 1 (135 points)

    I am in the difficult process of upgrading my 10.6.8 Server to 10.8 Server, so I can get back to  this after that has succeeded. Apologies.

  • Gerben Wierda Level 1 (135 points)

    Almost there. But what I can't do is use the "Original Folder" variable in the final "Move Finder Items" action. How do I set that? "Move Finder Items" only gives met the options of a list of directories and a "New Variable" which turns out to be a fixed variable I can set to a certain fixed folder.


    Screen Shot 2013-04-03 at 3 April 18.07.45.png


    How do I use that "Original Folder" variable for "Move Finder Items"?

Previous 1 2 Next