I have an Automator service (see below) which takes a folder of images and combines into a PDF.
But I would like the name of the PDF to be based on the name of the first (or any) of the images.
I.e., if the images in the folder are
- ProjectFoo-Frame1.png
- ProjectFoo-Frame2.png
- ProjectFoo-Frame3.png
I want the PDF to be called something like "ProjectFoo-Frame1.pdf"
Been scratching my head with Automator variables and can't make sense of it. Maybe I need to do this with pure Applescript.
Thanks.
Best Answer
Note that the following was tested and works for me as shown, under macOS Catalina, to have the created PDF document named for the name of the first file in the sorted files list.
With the Automator Quick Action set to Workflow receives current [folders] in [Finder], the following actions achieve the goal.
Get Folder Contents
Sort Finder Items
Set Value of Variable
Run AppleScript
Set Value of Variable
Get Value of Variable
New PDF from Images
Rename Finder Items: Name Single File
Reveal Finder Items