Help me with Folder Action scripts in Mac OS X.
March 31, 2004 5:23 AM   Subscribe

A question about using Folder Action scripts in Mac OS X and tinkering with them to get them to do what you want. [more]

I created a folder called Make PNG and attached the "Duplicate as PNG" Folder Action script to it. It wasn't doing anything with PDFs (screen captures) I dropped on it, so I edited the script to accept PDF files too.

Here's the problem:

PDF screen capture is 44K. PNG generated automatically by the script is 100K. If I instead use Preview to export the PDF to PNG (best depth, non-interlaced) the size is 56K. There's no visible difference between the different PNG files, but I want the script to give me the smaller file size since I'm converting things to PNG in order to optimize them for the web. How can I edit the script to do that?
posted by emelenjr to Computers & Internet (7 answers total)
 
Well, it could be because the script saves the file "with icon". When you upload the file to a website, the resource fork will be stripped away, including the icon. Upload the larger file to a non-Mac and check the new file size. If it matches the "export" file size, then that's your problem. Take out the words "with icon" from the line "save this_image as PNG in file target_path with icon" in the script and that should do it.
posted by bcwinters at 7:17 AM on March 31, 2004


Do you have photoshop?

Automated droplets are many times more powerful than the folder actions.

File > Automate > Create Droplet. Do this with any action set.

I simulated the above conditions and turned a 704kb pdf screenshot into a 164kb non-interlace/128-colors/88%-dither png.
posted by evilbeck at 7:47 AM on March 31, 2004


Response by poster: bcwinters, that's exactly what I needed to do. Taking out "with icon" resulted in a smaller PNG.

(I'm currently operating without Photoshop, making do with what I've got here.)
posted by emelenjr at 10:00 AM on March 31, 2004


FWIW, on the mac, you don't have to capture screenshots as PDFs, they can be copied straight to the clipboard.

[A] + SHIFT + 4.

I've even switched the two commands in the System Prefs > Keyboard & Mouse > Keyboard Shorcuts menu so that the usual ([A] + Shift + 3) key command clips to the clipboard. Then I paste into Fireworks or Photoshop and I'm off to the races, no annoying clipping from the PDFs.
posted by zpousman at 1:20 PM on March 31, 2004


Ditto, zpousman. I just wish it didn't capture those pictures in tiff format, because when I email people screenshots they sometimes are stumped by the tiffs.
posted by jragon at 4:30 PM on March 31, 2004


Response by poster: I have no idea what key combination you're referring to. [A] for Alt (Option)? Shift-Option-4 triggers a beep. [A] for Apple (Command)? Command-Shift-4 turns the arrow cursor into crosshairs so you can select a region of the screen.

(Checks System Prefs...)

Ah, you meant Command. Sorry, I didn't follow you there at first.

Editing the default keyboard shortcuts is a handy thing, but I still like the Folder Actions option instead of taking a screenshot and having it go directly to the clipboard because doing it that way doesn't require firing up Preview/Photoshop/whatever, pasting the clipboard contents into a new document and saving that. Seems like too many extra steps.
posted by emelenjr at 5:34 PM on March 31, 2004


Response by poster: Eh, that wasn't clear. "That way" meaning the Folder Actions way.
posted by emelenjr at 5:36 PM on March 31, 2004


« Older Windows XP - need password   |   What to do about an incorrect car accident... Newer »
This thread is closed to new comments.