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

Automator: Ask for Text > name file

I'm designing an Automator workflow that is:


Get Selected Finder Items (my intention is to only feed it a series of JPG's)

Scale Images

Ask for Text (question: what do you want to name this PDF? answer: to be filled in by the user each time the script is run)

New PDF From Images:

Save Output to: Desktop

Output File Name: <empty field>


So how do I tell Automator to fill in the output file name with the same text that it received in Ask For Text, the step before?


See the screenshot, if that's helpful:


User uploaded file

Mac Pro 8-core (2 x 2.8), Mac OS X (10.6.7)

Posted on Oct 31, 2011 11:02 AM

Reply
Question marked as Best reply

Posted on Oct 31, 2011 11:28 AM

Note that the results from any given action are passed on to the next action(s). In your example workflow, you are adding text to the selected files you are passing to the PDF action.


You can rearrange your workflow by asking for the text, put it into a variable, and clear the input before getting your files, but the New PDF from Images action doesn't accept variables for the output name. You can add a Rename Finder Items action to rename the resulting file using your variable for the name, but since you are putting up a dialog anyway, you can just show the New PDF from Images action when the workflow runs, and fill in the name there.

7 replies
Question marked as Best reply

Oct 31, 2011 11:28 AM in response to David Das

Note that the results from any given action are passed on to the next action(s). In your example workflow, you are adding text to the selected files you are passing to the PDF action.


You can rearrange your workflow by asking for the text, put it into a variable, and clear the input before getting your files, but the New PDF from Images action doesn't accept variables for the output name. You can add a Rename Finder Items action to rename the resulting file using your variable for the name, but since you are putting up a dialog anyway, you can just show the New PDF from Images action when the workflow runs, and fill in the name there.

Oct 31, 2011 11:46 AM in response to red_menace

Thanks a lot for that. After a bunch of research I solved it -- but it's way more complicated than I thought it would be! I had to do:


Get Selected Finder Items

Scale Images

New PDF from Images (give it a static name: zztemppdf)

Ask for Text (prompt user for filename, and make sure to tick the Options: Ignore This Action's Input)

Set Value of Variable (created a new variable called pdfname)

Get Specified Finder Items (point it to zztemppdf)

Replace Text (replace zztemppdf to variable pdfname)


Then it worked!


(How much simpler would it be if New PDF from Images just allowed me to drag in the variable right then and there -- but it doesn't. Also, the downside of this workflow is it requires my username to be exactly what it is -- since it stores an absolute path to my username's Desktop folder.)

Nov 1, 2011 9:42 PM in response to red_menace

I just tried that -- that is indeed the simplest way. Thanks so much for the help!


As with other things, I've found Automator helpful but it often takes several tries/attempts to get it to do what I want. It's unfuriatingly not Apple-simple, and is sometimes pretty limited, and this isn't the first time I've had to ask for help. 🙂

Automator: Ask for Text > name file

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