Hi! I'm new to KM and am trying to set up a Macro that lets me quickly convert two or more images into one PDF file. I have an Automator action that does that via the Services menu, but I'd love to be able to have a one-key solution. I've tried setting it up in KM, but the PDF generated is blank. I'm not sure how to get the images selected.
What other information would you like from me? Thank you for your help!
Hi JMichaelTX. I have tried KM Execute an Automator Workflow. It created a PDF, but it was blank. The selected images were not in that PDF.
Here is the Automator Workflow:
Workflow received current [image files] in [Finder]
New PDF from Images
Save Output to: [Desktop]
Output File Name [Name Me!]
• Size Each Page to Fit
End of Automator Workflow
KM Macro:
Convert to PDF
This hot key: [F9] is pressed
Will execute the following actions:
Exceute "Convert to PDF" Automator Workflow
~/Dropbox/Convert to PDF.workflow
End of KM Macro
These two produce a PDF with the proper name, but the contents is blank, even when the images are selected prior to running the macro. It doesn't seem to matter where the actual Workflow file is located.
Running the workflow from the Services menu outputs the result (joined images into one PDF) correctly.
I downloaded and installed your Macro. I selected my images and ran the macro. I selected the two images and pressed the hotkey. One of the images was deselected. That's all that happened. No PDF, no Finder reveal. Did I miss something?
How does the Workflow get its input? Does it base it on the Finder selection? I would expect that to work from an Execute an Automator Workflow action. But if the input is from some other mechanism, that might be an issue.
Keyboard Maestro wont send any input to the workflow per se.
It's based on a Finder Selection. I select two or more images, right-click the mouse, and select "Convert to PDF" from the Services menu. It works perfectly when done this way.
When I open KM and assign a hotkey macro to run the Workflow, using Execute an Automator Workflow, a PDF is generated, but it's blank. The Finder selection is not used. The Automator Workflow I use in the macro is from the services menu. I've also tried using the exact same workflow placed elsewhere on the HDD. Same result. For some reason, the workflow is not run properly when invoked through KM.
The Execute an Automator Workflow action is simply a wrapper to call the command /usr/bin/automator, so you could try using the Terminal and running the command:
/usr/bin/automator /path/to/your/workflow
See if it works and/or if it gives any indication of an error.
My guess would be that the system is blocking the access to the Finder Selection, maybe because of the new Automation permissions (check your System Preferences, Security & Privacy, Automation settings and see if there is anything there that looks like it needs adjusting).
Both of these fail on my system. (macOS Sierra 10.12.6)
With two test images @Athena sent me I get the same screwed up 896 byte file for output with each of those actions.
At least they're consistent.
In order to get this critter to run correctly I have to run it from the Services menu, and I'm doing that with a Keyboard Maestro Select or Show a Menu Item action in the Finder.
I would guess that this “Quick Action” workflow is expecting to get its input as specified, but that that happens as part of the Finder/system running the workflow, not as part of the workflow itself being run, hence the warning and the behaviour.
I suggest you follow its instructions and create a new workflow, and add the Get Selected Finder Items action to the front, and that works fine in my tests.
The KM macro (Convert Selected Images to a PDF File v1.02) is not working for me.
I tried to follow all instructions in this thread, but I still get a blank pdf whenever trigger the KM macro posted here. In all, I've tried the following:
select images and run Convert to PDF.workflow from Automator
select images and execute this line in Terminal: /usr/bin/automator /Users/tony/Library/Services/Convert\ to\ PDF.workflow
select images and trigger KM macro (Convert Selected Images to a PDF File v1.02) using hotkey
Results
(1) produces the desired PDF from images
(2) and (3) produce blank pdfs
(2) gives error message: The action “New PDF from Images” was not supplied with the required data.
I also tried restarting with no change. I'm using an M1 Mac Air running KM 9.2 on Mac OS 11.5.2
Here are screenshots of the System Preferences settings mentioned by Peter and the dialogs I saw while doing all of the above. I granted permission in each case.
Hi Tony. I'm attaching my Automator Workflow and KM macro. I'm using Big Sur, but not on an M1 Mac. I've confirmed them working on my system as of this morning. I hope they help.
Please reply if they don't and I'll try to assist.