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

kijunam

macrumors newbie
Original poster
Apr 8, 2018
4
0
Hi Together:

It's amazing but I cannot find a solution for a task, which I think many people may need.
There are hundreds of solutions for combining JPGs into one Pdf but no one, which creates for each found jpg one single pdf with the same filename


I would like to achieve the following:

1.) Select Folder in Finder
2.) Start Automator or Script which does the following
- Search all subfolders
- If Picture is found, create PDF with pictures name at found location

That's all but I cannot find a solution other than buying AdobePro for 800$ which I would like to avoid, if possible.

Can someone help me?
 
I'd suggest you just use the command line to do this for free - something like this:
- Open Terminal
- Run: IFS=$'\n'
- Run: for i in `find "/path/to/root/folder/" -name *.jpg`; do sips -s format pdf "$i" --out ${i%.*}.pdf; done

Some notes, since I've no idea how familiar you are with the command line:
- Substitute the root folder location in the second command.
- Check the quotation marks if you copy and paste this. macOS tends to change quotation marks to make them look pretty. There are single, double quotes and backticks (`) in there.
- The pdf's that are created will OVERWRITE any existing pdf files of the same name.
- You could obviously put these commands into a parameterised script if you need to do this often.
- Always test commands/scripts that other people provide in a test directory :)
 
  • Like
Reactions: neliason
Dear Kingcr:

Forst of all, thank you for your time and help.

Unfortunately, It worked only partial.
The result was, that the first JPG (1st out of 4) was converted into PDF but the script seamed to stop afterwards. The remaining 3 are still unconverted.

I copied the following:

IFS=$'\n'

for i in `find "/Users/fk/Desktop/Test/2017-12" -name *.jpg`; do sips -s format pdf "$i" --out ${i%.*}.pdf; done


The message from Terminal was:

/Users/fk/Desktop/Test/2017-12/11_2017-12-25_Lunch.jpg

/Users/fk/Desktop/Test/2017-12/11_2017-12-25_Lunch.pdf
 
Last edited:
Dear Kingcr:

Forst of all, thank you for your time and help.

Unfortunately, It worked only partial.
The result was, that the first JPG (1st out of 4) was converted into PDF but the script seamed to stop afterwards. The remaining 3 are still unconverted.

I copied the following:

IFS=$'\n'

for i in `find "/Users/fk/Desktop/Test/2017-12" -name *.jpg`; do sips -s format pdf "$i" --out ${i%.*}.pdf; done


The message from Terminal was:

/Users/fk/Desktop/Test/2017-12/11_2017-12-25_Lunch.jpg

/Users/fk/Desktop/Test/2017-12/11_2017-12-25_Lunch.pdf


I found the problem. The first file had the ending jpg , the other 3 JPG. Is there a way that it does not matter?
 
Sure there is. Just replace the "-name" parameter to the find program with "-iname" so that it performs a case-insensitive search.

So your commands would look like this:

IFS=$'\n'

for i in `find "/Users/fk/Desktop/Test/2017-12" -iname *.jpg`; do sips -s format pdf "$i" --out ${i%.*}.pdf; done
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.