Code
Terminal - the Find command Print E-mail

The unix "find" command is worth getting to know. Fire up the terminal and give it a try.


For simple searches you need provide nothing more than a directory to start searching:

find $HOME


This is a bit basic :-) it finds everything in your Home directory. But we can be a bit more selective:

find $HOME -name "*.tif"


This command searches your Home directory for any files whose names end with ".tif". The "*" is a wildcard. If you also want to find files that end with ".TIF" then you can use -iname instead of -name.

If you want to find all the files that don't end with ".tif", you can do this:

find $HOME \! -iname "*.tif"


There are too many modifiers to the find command to cover here. If you need more information you should type:

man find


The real advantages of using find is the fact that we can add modifiers to make our search more specific. Let's say we want to find every ".tif" file that has been modified in the last 2 days:

find $HOME -iname "*.tif" -mtime -2


We can also move or copy the files to another location by invoking another command:

find $HOME -iname "*.tif" -mtime -2 -exec cp {} /Users/myName/Desktop/archive \;


So, here we've found all the files that end with ".tif" (with or without caps) that have been modified in the last 48 hours and copied them to a folder on the desktop.

Hopefully you can see how powerful this single line could be if you use it as a backup strategy or a way of retrieving data without having to open and search loads of folders by hand.

You can also use it to copy the music files that are hidden on your iPod back to your hard disk:

find . -iname "*.mp3" -exec cp {} /Users/myName/Desktop/music \;


Note the "." after the find command. This means that the search starts from the current location. So all you need to do is type "cd " in the Terminal, then drag and drop your iPod on to the Terminal window and then hit return to get to the right place to run the command. Make a new folder to copy your music to and then drag and drop it on the Terminal window after the "{} " and the Terminal will complete the paths without you having to waste time typing it all in.

As with all Terminal commands, please be careful with what you type. Powerful commands can lead to big problems if you type the wrong stuff in accidentally.

 

 
Idea Applications Print E-mail
We build scripts and applications for in-house use.

Our in-house projects include job bag databases and automated production workflows.

Every so often we'll publish something for fun.

 

 

ImagePSLogSearch
PSLogSearch is an AppleScript Studio application that enables you to quickly search the History Log file in Photoshop CS or CS2 (previous versions don't have the option to write a log file).

To use it you simply launch the application, locate your log file and start searching.

Click to download PSLogSearch - 88k disk image for Mac OS X 10.2 and newer.


PhotoShirk
Photoshirk is an AppleScript Studio application that mimics the "Save" dialogue in Adobe Photoshop.

To use it you simply launch the application, press a number key that represents the number of minutes that you want dialogue to stay on screen for and hit the Return key.

Click to download Photoshirk - 80k disk image for Mac OS X 10.2 and newer.


ImageRowingPace
RowingPace is an AppleScript Studio application that takes the guess work out of pace calculations.

Enter up to five distance/pace values and RowingPace will calculate the total distance, finish time and average pace.

Click to download RowingPace - 80k disk image for Mac OS X 10.2 and newer.




ImageResizeImage
ResizeImage is an AppleScript droplet that will scale most images and save them to the Clipboard. You can then paste them directly into a Text Edit document or Mail document etc.

Just drag an image on to the application icon and choose the amount you want to scale the image by (from 10% to 200%). ResizeImage will beep when the image is ready to paste.

That's all it does :-)

Click to download ResizeImage

ResizeImage will handle: TIFF, BMP, JPEG, GIF, PSD*, PDF**, TGA, & SGI image formats.

*ResizeImage will not work properly with layered Photoshop files.

** ResizeImage will only render the first page of a PDF document.


AbstractA4 - generate abstract art in Adobe Photoshop
AbstractA4 is an AppleScript application that will create high quality A4 images in RGB.

On launch, you will be asked how many images you'd like to produce and where you'd like to store them. AbstractA4 will then create a new Photoshop document and begin making art before your eyes.

On completion of each image, AbstractA4 will create a smaller thumbnail version and save both to your chosen folder. If you've asked to produce more than one image it will then start the next masterpiece.

Click to download AbstractA4

 

Related Items

Joomla Templates by Joomlashack
Joomla Template Design