Folder Action script image conversion
Wouldn't it be good to have a jpeg or tif of your screenshots, rather than a pdf? With Folder action Applescripts you can. If you follow the simple instructions you will be able to choose between converting to tif, jpg or keeping the pdf. Download the ScreenCaptureConverter.scpt Actionscript file that I modified based on a code I found at BinaryBonsai long time ago and put it into your Library/Scripts/Folder Action Scripts folder.

Next, just CTRL-Click on your Desktop and choose Enable Folder Actions (if it's not already enabled) and than choose Attach a Folder Action... and navigate to the script file you just downloaded. From now on, whenever you make a screenshot and than select the file named Picture 1 on your desktop a small window will pop-up asking you whether you want to convert this pdf into jpeg or tif.

This script not only converts the pdf, but it also names the new file to a more descriptive Screen Capture Picture 1.jpg format, trashes the old pdf and adds an icon preview.
You can do other similar things with ActionScripts that are in the same Library/Scripts/Folder Action Scripts folder. For example a useful thing could be to convert a bunch of tifs to jpegs. First create a folder with a name like tif->jpeg, then attach the Image - Duplicate as JPEG.scpt script to this folder from the same place. Next, just drop the images that need to be converted into this folder. Finally just watch how the tifs get converted and neatly placed into subfolders. Be patient, the CPU has to process the image.
Also, read about how Actionscript can notify you if someone drops a file into your dropbox or if you receive a fax.
- Ivan's blog
- Login or register to post comments



Cool tip
Cool tip, thanks!
I also came across this nice little bit of freeware called SnapNDrag. It allows you to take a screen-shot and specify tif, png, or jpg (w/ quality slider). It has the same options as Apple's built in key commands... screen, window, selection.
_________________________________________________
portfolio - www.paulburddesign.com
weblog - www.onedigitallife.com
A little thing..
If I'm not mistaking I've read somewhere that the grab tool in Mac OS X 10.4 Tiger now can save directly to JPG.. I'm not sure yet because I haven't seen it or tested it.. Perhaps I'm wrong..
Grab
I just tried it, it looks like Grab will only do TIFF. In 10.1 you could use this terminal command to change the default screen capture format...
"defaults write NSGlobalDomain AppleScreenShotFormat imageFormat", subbing "imageFormat" with TIFF, JPEG, etc..
In 10.2 there is a pref somewhere to choose your default format. I forget where it was.
In 10.3 it looks like your stuck with PDF for the key-command, and TIFF for grab, unless you use a 3rd party app.
_________________________________________________
portfolio - www.paulburddesign.com
weblog - www.onedigitallife.com
For those of you with Panther...
I have created a script link for easier access to the code. All you have to do is click on the link below and it will open script editor and create the code for you. Just thought I'd show this cool feature for those of you who hadn't heard of it.
Script Link
Also, I do quite a bit of AppleScripting so I can probably be of assistance to any of you who want a script ...or if you just want some questions answered.
EDIT: ...crap, the script link doesn't work on this board for some reason. Ivan, it's just a tag. Is there any reason it's not working?
Allowed it now.
You were doing it all correctly, but such script are set up to be filtered for security reasons. These things can be dangerous.
Btw. this is excellelent. What kind of scripts did you do before?
All sorts...
Mostly small scripts ...scripts to check uptime, check stocks (which will no longer be needed with Tiger) ...scripts to check F@H. Dunno if you have seen my developer site, but the two F@H monitoring apps I have on there are all done with AppleScript Studio.
I also do a lot of scripts to mount volumes, mess with invisible files, retrieve archived jobs at work, and do things remotely on my home machine. It's really cool actually. For instance, my IP is pretty static for the most part, but it does change every once in a while. If I find that my domain name isn't working anymore I know it has changed. If I'm at work all I have to do is send myself an email with "Check IP" in the subject line and when my home machine receives it a rule that I have set automatically runs an AppleScript that grabs the current IP and emails it back to my work address.
Always looking for more ideas! ;)
script to convert image, grab new one every 15 secs & upload ftp
Hi - I've got this very simple script and now I would like it to do three more things:
convert image from tiff to jpg, grab a new image every 15 secs from a streaming video, and FTP uploading to my server. The image can be overwritten
since FTP uploading should cycle & catch the replaced image every 15 sec.
tell application
"Wirecast"
tell last document to save snapshot to "/Users/BirdBox/Desktop/snapshot.tiff"
end tell
Can I use the code to convert the images as described above? Where can I get this code. Then is it possible to set up one of the ftp droplets to automatically check for a new image.
Thanks for any help!
Kata
very cool
Just in case there are some of you who didn't already know... holding down the control key while taking a snap shot in OS X will capture to the clip board... you can then easily paste in Photoshop or whatever. Sometimes I use this to capture my screen and send it over to another designer via iChat just by pasting it in the chat window - very handy
more key-commands
As long as we're listing them...
CAPTURE TO FILE:
cmd + shift + 3 = screen
cmd + shift + 4 = selection
cmd + shift + (release) + spacebar = window
CAPTURE TO CLIPBOARD:
cmd + cntrl+ shift + 3 = screen
cmd + cntrl + shift + 4 = selection
cmd + cntrl + shift + (release) + spacebar = window
Did I miss any?
_________________________________________________
portfolio - www.paulburddesign.com
weblog - www.onedigitallife.com
the scripts are applescript not actionscript
I can see what you mean as the folder the scripts live in is called "folder action scripts" but the language is called Applescript, calling it actionscript is wrong.
Yes, it's AppleScript...
but he was actually right as well. What he meant was that it is a "Folder Action" AppleScript. A special kind of script that can be attached to a folder so things happen when you interact with it in certain ways.
You can tell when a script is a Folder Action when it starts like "On Adding Items to..." or "On Removing Items From..." etc.
They have to be written in that special way otherwise they won't work. Also, the "Folder Action Scripts" folder is the default folder that shows up in the menu when you choose to attach a script to a folder.
yes of course
I've edited it in the bodytext for clarity.
the script overwrites
If you talke multiple screenshots en you convert them to the same formats, the script overwrites previous screen shots. I don't know applescript very well... but I'm trying to work around it, another if,then, rename should do the trick... right?
Ivan, you rock. Just
Ivan, you rock.
Just catching up on all the posts... I've been tied up for awhile. The Jpeg option on screenshots will prove to be a huge timesaver for us. Once again, where's the freakin' tip jar? lol :)
Terry Thornhill
e-zign Design Group
QuickImageCM
Something I've found extremely useful for this is QuickImageCM. It's a contextual menu plugin that lets you convert an image to a variety of formats in a single click. It has quite a few other options as well, including viewing and printing images without having to open an app.
Tiger Screenshot FYI:
PNG Now Default Format for Screenshots
When using the system’s built-in keyboard shortcuts for screen captures (Command-Shift-3 to capture the screen, Command-Shift-4 to capture the selected area), output files are now saved as PNGs. In Mac OS X 10.2 and 10.3, these screenshots were saved as PDFs.
Terry Thornhill
e-zign Design Group