Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

newbie automator question: save file

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?

Posted on Aug 14, 2012 4:04 PM

Reply
24 replies

Apr 3, 2013 9:35 AM in response to pjdube

That almost did it. What was needed was to set 'ignore input' on a few actions or the result ended up in some temp directory somewhere deep in the system. Otherwise, the target directory was the temp directory that PDF to JPEG uses.


User uploaded file


What is now left as a problem is that this temp directory (that is reused seemingly) still has a few copies of the jpeg, so if I act on foo.pdf I get foo-3.jpeg. I can remove those now as the above says where it is, but if I ever get a problem it will be difficult to find the temp directory to clean stuff out. I can't think of an wasy more robust flow.

Apr 3, 2013 1:18 PM in response to pjdube

https://dl.dropbox.com/u/59305058/PIF.workflow.zip


Our work flows are identical. It works for me too. But during development, when the 'ignore input' flags were not properly set, the final move failed (because it moved the file upon itself). A second call the lets PDF to JPEG create a 'duplicate' file name, e.g. foo-1.jpeg. This one keeps sitting in that temp directory and messes things up.


Removing the stray jpegs from the directory lets the flow work properly.

Apr 3, 2013 2:10 PM in response to Gerben Wierda

Ok, so I tested yours... and... everything worked perfectly!


Unless I am mistaken on what you are trying to do exactly. I ran your Service on a PDF that was in a Folder on my desktop and the below is the result. I actually ran it on a BIG PDF to make sure that it worked.


See below. And let me know if you are trying to do something else exactly, or maybe there is some other bug that is not allowing you to run the service.


User uploaded file

Apr 3, 2013 10:45 PM in response to pjdube

Yes, as I said, mine works fine too.


The effect I was looking at was the result of it running a few times when it was not OK yet. Probably you can get the same effect by running it once or a few times on the same PDF file without the last step. Then run it again on the same PDF file.


It only happens when something has gone wrong (which was the case during development).

Nov 20, 2013 1:55 PM in response to Gerben Wierda

Gerben and Pjdube-


Good afternoon!


I have read through this thread and am interested in getting a look at the workflow's you created (wherein you both stated arriving at the same structure and results).


This is my first attempt at Automator and I am looking to either combine multiple existing PDF's or input an Adobe form filled pdf and convert to a pdf which lacks field controls.


Particulary how are outputs from each item in the workflow passed to the process as a whole or "ignored"?

User uploaded file

May 29, 2015 1:52 PM in response to Gerben Wierda

Apparently, all you need to do is copy the files first:


Duplicate Finder Items


The copies will be placed next to the original files, then the copies will be sent on to the next action. If the next action is something like:


Change Type of Images


then Automator will tell you that the action is going to change the files, and then Automator will ask you if you want to make copies so that you can preserve the originals. But in this case, the originals are already copies, so you can safely decline. The Duplicate Finder Items action will not overwrite any files. It adds 'copy' to the end of the file name, but if that file name already exists, then it will add 'copy-1' to the end of the file name, etc. Therefore, the file name that the Change Type of Images action receives will be the name of a newly created file.


User uploaded file


And, if you want to change the name of the copies to something more meaningful, you can use a Replace Text in Finder Names action after the Duplicate Finder Names action. The information in this post was inspired by: http://superuser.com/questions/240439/mac-automator-save-to-current-directory

newbie automator question: save file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.