Applescripts
Here are some Applescripts that I thought I could show off. Feel free to use and modify them as you please. If you'd like to contribute your improvements — great! Just drop me a line.
Skype users, you are probably looking for Peek-O-Matic.
Make Nifty Box Note
- Make Nifty Box Note is an Applescript that inserts a note into the tagging application Nifty Box, a feature I really needed Nifty Box to support.
- This Script is best used with Quicksilver: Enter a string for a note title in Quicksilver, Tab, process string with..., Tab, Make Nifty Box Note.
- What the script really does is create an RTF file in the Folder ~/Library/Application Support/Nifty Box and insert that file into your Nifty Box.
Download Make Nifty Box Note
Get Message Ref
- Get Message Ref is a tiny application that gets a reference to the currently selected message in Mail.app. By means of that reference (which can be an URL or a file), you can later directly reveal that message.
- Mac OS X Leopard directly supports message references, so you don't need Get Message Ref there.
- The download version is configured to create a URL reference and copy it to your clipboard.
- This Script is meant to be invoked using the fabulous Quicksilver, but works just as well without Quicksilver.
- Get Message Ref is quite powerful, and can be configured extensively. The configuration process is, alas, far from straightforward. Here's how to do it:
- Ctrl-Click on Get Message Ref's Application Icon and select the menu option Show Package Contents.
- Navigate to the subfolder Contents/Resources/Scripts.
- Open the file main.scpt with Scripteditor.
- Right at the beginning of the file, you see several lines starting with the word property. You change a particular property by changing the value after the colon. The properties are thus:
-- On creating a reference
property maxSenderLength : 17
-- Cut off Sender name after given number of characters
property maxSubjectLength : 45
-- Cut off Subject after given number of characters
property putMailRefIntoClipboard : true
-- Copy the message reference to the Clipboard
property showMailRefInQuicksilver : false
-- Uses Quicksilver's Command line tool to show the
resulting reference in Quicksilver
property outputAsFiles : false
-- Gives reference in form of a file. Otherwise (false): Output as URLs
property revealFilesInFinder : false
-- Reveal the reference in Finder (if outputAsFiles is also set to true)
property openWithApplication : ""
-- Open the resulting URL or File with the application
between the quotes (e.g. "Nifty Box")
-- On following a reference
property onRevealOpenMessage : true
-- Open message in a new Window in addition to
highlighting it in the messages list
- After changing the desired settings, save the script file, and you're done.
Download Get Message Ref
Launch as User
- Launch as User is an Applescript droplet that launches applications as another user and was inspired by this hint on MacOSXHints.com.
- Why would anyone want to do that? For example if you want to access your "normal" user's Mail or iCal from the administrator account you're currently working in.
- Launch the script to set the target user. Then, drag the application to launch onto Launch as User. You will be prompted for the target user's password and the application will be launched (this script is essentially a wrapper for su).
Download Launch as User
Version 1.1 of Launch as User also works with Mac OS X Leopard and doesn't require the admin password, only the target user's password. My thanks go – again – to Ben for reporting the Leopard incompatibility.
Peek-O-Matic
- Peek-O-Matic is very similar to Launch as User in that it allows you to run an application as another user. The only difference is that you bind an app permanently to the script by drag-and-drop. It then asks for a user name and remembers that, too. Henceforth, launching Peek-O-Matic launches above app as above user. Re-configure it by dropping a different app.
- Apart from its use, it's just like Launch as User above.
- I found that a significant number of users are using Launch as User to run two instances of an application at the same time, e.g. Skype.
Download Peek-O-Matic
Version 0.4 of Launch as User also works with Mac OS X Leopard and doesn't require the admin password, only the target user's password. Many thanks to Ben for reporting the Leopard incompatibility.
I'm trying to come up with a better name for this script. All suggestions are welcome.
Process with…
- Process with… is an Applescript droplet that allows you to feed files to a shell command by drag & drop.
- On its first launch, Process with… asks for a shell command (can be a binary or a script or anything) and remembers it. You can then drag one or more files or folders onto the Process with… icon and Process with… will call the remembered shell command with those files as parameters.
For example, when in a text editor, save your document, then drag the icon from your editor's window title bar onto Process with….
- Process with… does not yet support command line switches, but please feel free to modify the script to fit your requirements. If you think your enhancements should be included, contact me.
Download Process with…
QuickMount
- There are people who think that the checksum verification of DMG disk images is nothing but a waste of time. If you're one of those poor deluded souls, QuickMount is for you.
- QuickMount is an Applescript droplet (a mere shell wrapper to be precise) that mounts one or more disk images with the -noverify switch. Drag one or more disk images on the QuickMount icon and QuickMount will mount them, skipping the checksum verification.
- The nifty thing is: QuickMount will remember what disk images you mounted with it last time. So if you just double-click on QuickMount the next time, the last-mounted disk images will be mounted automagically.
Useful e.g. for your Startup Items
- If you're like me and actually want checksum verification, edit the QuickMount script and scrap the -noverify in the line starting with do shell script.
Download QuickMount (In German, but I'm sure you'll handle)