Illustrator: Flip selected object Horizontally or Vertically

Yes, illustrator offers a really nice “reflect” tool. But I prefer using command + Shift H or command + Shift V and don’t care much for the “paste in place” I replace, as I’m happy with paste in front and -back.

tell application "Adobe Illustrator"
if (count page items in document 1) > 0 then
set selectedItems to selection
set scaleMatrix to get scale matrix horizontal scale 100.0 vertical scale -100.0
transform every item in selectedItems using scaleMatrix
end if
end tell

I’m using them with the wonderful Fastscripts, by red sweater, since it takes a very sane approach to scoping (limiting to intended application) the installed scripts.

Grab the scripts HERE

Illustrator: resize All artboards to the art present on themselves

This illustrator script selects the art on every artboard, and resizes the artboard to it.

For a batch rescale assignment (It ended up as 900 png’s) I needed a *lot* of artboards. Since the artboard tool in illustrator isn’t the best performer, even on modern hardware, this is what I ended up doing:

• Group the icons to rectangles without appearance, sized to the artboards.
• Duplicate the artboards to as many as are needed.
• Rescale the objects on them. Tweak where necessary, make sure extents are on whole pixels.
• Run this script
• Export using the wonderful “multiexporter.jsx”

This is a heavily modified version of a script I found HERE.

download the script HERE

Automatic Flight Check for iOS Retina Files

In iOS development it’s important to keep your image assets exactly double each others size.

This Applescript will color your files according to their presence and size relative to their “twin”. You can stick it to a folder using a folder action, or, better yet, using the included Hazel action, since that will also pick up on changes to files (regular folder actions only trigger on adding or deleting).

• GREEN = OK
• RED = Missing standard resolution
• ORANGE = Missing retina resolution
• PURPLE = Twin present, but wrong size

You can easily modify the script to remove the green labelling for files that are OK, I’m keeping it in for now to get feedback on if the script has run at all :)

Set it up in hazel like this:

Grab the script HERE!

Applescript to quickly batch resize, crop or pad images.

Ever since I left Quicksilver for Butler, and later Alfred – I was left with a batch image-resizing itch. To scratch it, I wrote this applescript (and Alfred extension). The script will ask you what to do, and takes your selection in the frontmost finder window, and performs image manipulations on it (Using a command line utility called “sips”).

Specifically:
Rescale

    If one dimension is given, it resamples image(s) so height and width aren’t greater than the specified size, keeping aspect ratio.
    If two dimensions are given, it resamples the image(s) to the given values, ignoring aspect ratio.

Crop

    Crops the image(s) to the given dimensions. If only one value is entered, uses this for both sides.

Pad

    Pads the image(s) to the given dimensions. If only one value is entered, uses this for both sides.

To use this script with Alfred, you’ll need to get the powerpack too, which was totally worth it for me.

Grab the script here!
FYI: SIPS (and as such, this script) supports the following file formats: jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga – I tested it on a psd, and it worked, but be aware it flattens the file :) Also, no, the script does *not* check beforehand if you have the right kind of files selected.

Applescript, Service and Hazel rule to clean ZIP files of .DS_Store and __MACOSX cruft.

It performs the following commands on the selected zip:
zip -d Zipfile.zip \*.DS_Store
zip -d Zipfile.zip \*__MACOSX*

Which is just a long way of saying it deletes those files from any zip you feed it. Makes you popular with the Windows half of your network ;)

I included a service (Automator) that lets you run these commands on arbitrary files. I suggest feeding it a zip – and not an application bundle :)

I also included a hazel rule that applies this action to any zip on your desktop :)

To use this script with Alfred, you’ll need to get the powerpack too.

Grab the scripts here!