Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to convert screenshots to JPG format' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to convert screenshots to JPG format
Authored by: derrickbass on Apr 07, '04 01:43:44PM

I would take out the rm command. As it is written, if something goes wrong with the conversion, the original file will be deleted anyway. Alternative, you can check the return value of the sips command and only execute the rm command if it succeeds.



[ Reply to This | # ]
A script to convert screenshots to JPG format
Authored by: Rainy Day on Oct 25, '05 12:11:07PM
So the second and third lines should be combined something like this then:
/usr/bin/sips -s format jpeg theimage.pdf -o theimage.jpg && /bin/rm theimage.pdf;
The && between commands executes the second command only if the first completes without error.

[ Reply to This | # ]