Mystery in my Automator Script

Joined
May 18, 2018
Messages
2
Reaction score
0
Hi,

I created a script which works as follow : after I select a few PDF files in the finder, Automator combines these into a single PDF document and opens it in Preview. From there I take the control back and rename the combined document with a name i like and save it.

My script works fine in Automator, it consists of:
- Get Selected Finder Items
- Combine PDF Pages
- Open Finder Items (with Default Application)

When testing the above script within Automator, I get exactly what I want. Suppose I apply it on two PDF files (A and B), Automator produces a single PDF file with two pages (A - B). That's what i want.

However, and here is the mystery, when I run this very script from the Finder after having selected the same two files, Automator produces a single PDF file with four pages (!) instead of A - B, I get A - B - A - B.

So I need to delete a pair of A - B to get back to the intended result, which is a two-page document (not a four).

Any idea of why this is happening? or any way to fix it?

Thanks,
Lance
 

Attachments

  • Screen Shot 2018-05-18 at 11.24.18.png
    Screen Shot 2018-05-18 at 11.24.18.png
    80.1 KB · Views: 297
  • Screen Shot 2018-05-18 at 11.24.28.png
    Screen Shot 2018-05-18 at 11.24.28.png
    304.3 KB · Views: 302
  • Screen Shot 2018-05-18 at 11.25.28.png
    Screen Shot 2018-05-18 at 11.25.28.png
    340 KB · Views: 273
  • Screen Shot 2018-05-18 at 11.37.35.png
    Screen Shot 2018-05-18 at 11.37.35.png
    182 KB · Views: 298

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
Hello and welcome.

This is a much easier Automator Service workflow:

combinepdfservice.png


See if that works better for you.

C
 
Joined
May 18, 2018
Messages
2
Reaction score
0
Thanks Cory Cooper. You are right it is a much easier script and I realised what was wrong in mine thanks to yours. It was the "Get Selected Finder Items" which I was supposed to remove before to run the workflow outside of automator. The fact I did leave it was "duplicating" the files to combine hence the A-B-A-B instead of A-B. Many thanks!
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,089
Reaction score
490
Excellent...glad it worked for you. Thanks for explaining what the issue was in the original workflow, so that others may benefit in the future.

C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top