Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vloryan

macrumors member
Original poster
Jan 11, 2014
57
0
Guys,

this is probably very simple for all of you. I don't get it to work. I simply want to pass one PDF file only (not more than 1) withing the folder xpdf (on my desktop) to the next Automator action. Any idea how to do this with Applescript?

Thank you very much!
 

chown33

Moderator
Staff member
Aug 9, 2009
10,737
8,410
A sea of green
The "Run AppleScript" action in Automator gives you this prototype handler:
Code:
on run {input, parameters}
	
	(* Your script goes here *)
	
	return input
end run
Read the explanation of this handler here:
https://developer.apple.com/library...lAppleScript/WritingScript/WritingScript.html

Important point: 'input' is usually a list. So if the previous Automator action produces a list of PDF files, you want to output only the first item in that list.

So in AppleScript, knowing that you're given a list, write code that returns the first item in that list.

You should also show each Automator action's results, to confirm the output of the previous action is a list, and the result of the AppleScript action is a list or the single first item.
 

gujamin

macrumors member
Aug 6, 2002
66
0
Atlanta
Probably a bit late, but I created an automator action to pick the first or last item from a list of items.
 

Attachments

  • Choose.action.zip
    12 KB · Views: 448
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.