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

Use a folder action script to manage screenshot files Desktop
I have been working on a Folder Action Script (view the source) that can be attached to the desktop and will move any snapshot file created with Command-Shift-3 (it does not reliably handle images created with Command-Shift-4) to a "Screen Shots" folder on the desktop, changes the format of the file while adding a preview icon, and renames the file according to the time the snapshot was taken.

One major hurdle that I have not completely overcome, is that folder action scripts cause the front application to come out of focus. My partial solution has been to code everything without using calls to other applications. For example, everything that I would usually do with a tell application "Finder" call, I do using do shell script calls instead.

The other major hurdle was to make sure the PDF picture file that is created on the desktop is non-empty. It seems an empty placeholder is created before the real snapshot is placed on the desktop. This makes the script interfere with the command-shift-4 mechanism. It's also important to make sure it's not being written to. That is what makes things seem sluggish (OS X is not good at updating a file's state; I would imagine to increase performance, right?). I started this script by modifying an Applescript I found in the MacOSXHints forums (Applescript strcmp? by Lankhmart).

I hope it is useful, and that someone more knowledgable can help me improve on the above shortcomings.

[robg adds: A couple of previous hints discuss other methods of handling screenshots.]
    •    
  • Currently 1.00 / 5
  You rated: 1 / 5 (3 votes cast)
 
[9,619 views]  

Use a folder action script to manage screenshot files | 1 comments | Create New Account
Click here to return to the 'Use a folder action script to manage screenshot files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use a folder action script to manage screenshot files
Authored by: PeterDie on Oct 18, '04 06:32:24PM

Works as advertised, nice to be able to name the folder for holding the screenshots, the screenshots get a date-time related name. Very nice.
I've decided to convert the screendump to a jpeg file, very small and no visible quality problem.

Now I only need a FTP-content-of-this-folder-to-a-webserver-location-script for putting up occasional screendumps on a webpage.



[ Reply to This | # ]