Use AppleScript to ease Greek, super/subscripts in Word

Word 2008's synchronized audio recordings in Notebook Layout format are ideal for taking notes in college lectures, but what about that physics or math lecture where you want to type in a ton of Greek letters, superscripts, and subscripts, and the toolbox just won't cut it? Go to Word, open the Scripts menu, and in the About this menu... item, choose Open Folder. In that folder, create (using ScriptEditor) the following three AppleScript files. Note that the backslash (and following characters) in their names create keyboard shortcuts for each script, which you'll see in Word's Scripts menu: AppleScript #1: Save this one as GreekToMe\scC.scpt after pasting into ScriptEditor: set textReturned to text returned ...

published on Monday, the 27. October 2008, macosxhints

Easily add lyrics to iTunes songs via AppleScript

Often programs like PearLyrics or SingThatiTune just don't find the song I am looking for, and I have to find the lyrics manually. I found it tedious to find the lyrics in Safari, switch back to iTunes, highlight the song I want to add the lyrics to, open the song's info panel, paste in the lyrics, and finally, close the window. So I wrote this simple AppleScript instead: tell application "System Events" set sel to (the clipboard as text) end tell tell application "iTunes" set lyrics of current track to sel end tell I then bound this AppleScript to a keyboard shortcut using iKeys (any macro-capable program should work just as well). It will copy any text currently in the clipboard to the currently playing song's lyrics.

published on Wednesday, the 16. July 2008, macosxhints

fn 1.1

[fn 1.1] - Designed and Developed by circa86 in 2008. Mac OS X 10.5 & up. (Possibly works under 10.4) The purpose of 'fn' is simple. All Apple keyboards have an excellent set of hardware Fn keys to control things like brightness, volume, etc. But sometimes, those keys that are usually so helpful, can get in your way. There are many different high end Applications out there that use the F1-F12 (and beyond) keys as very important shortcuts. Apps like Maya, After Effects, and so on. Well 'fn' just makes jumping back and forth between your normal everyday workflow (where the hardware fn keys are very useful), and your higher end App workflow. 'fn' is just an App that merely changes a System Preference in one click, put the item in your Dock, launch it, and it will run quickly and turn ON/OFF the hardware shortcut keys. (If they are off you merely use the (fn) key + the normal hardware shortcut key as you normally would if this setting was checked). This Application was created using Applescript, and can be examined by simply right clicking on the App and clicking 'Show Package Contents' where you will be able to find the AppleScript, among other things. Feel free to utilize the embedded script in your own Apps, I would love to hear how it may be used, as I am always wanting to learn more. [for any issues or concerns, feel free to email me at]: circa86@gmail.com Enjoy!

published on Sunday, the 22. June 2008, scriptbuilders

Move and resize app windows via AppleScript

I'm a neatness freak, and I hate lots of messy overlapping windows everywhere. But I'm also a keyboard junkie, and I hate using the trackpad a lot. And I don't want anymore background processes hogging memory, or more applications to open for such a simple task -- so what to do? Answer: AppleScript. I wrote a collection of AppleScripts that use System Events to control the window size and position of the frontmost application. Also, the window snaps to a grid to make it easy to place next to other windows without overlapping. You can find the scripts on my iDisk public folder (Go » iDisk » Other User's Public Folder, then enter phildooher). Download the zip file and put the (nine) scripts in your usual script folder. The scripts are known to work on OS X 10.4.11, but are untested on 10.5. [robg adds: I tested a few of these, but not all, on 10.5, and they seem to work as described.] Assign keyboard shortcuts to these scripts (using Quicksilver o...

published on Wednesday, the 28. May 2008, macosxhints

iTunes Manager 2.8.1

iTunes Manager is a mini-window to iTunes that performs a number of functions beyond mere music playback. The functions include music alarm, playlist-track switching and selection, volume control, key information about the active track, playlist and track editing, and keyboard shortcuts for playback and other controls. iTunes Manager now wraps in AppleScript Studio interface the utilities to manage filetracks, track data and playlists, gaining the following advantages: it is now simpler and easier to run; the utilities are just a mouse-click away; response time to activate the utilities is quick; and, the overall interface is certainly more appealing than the pure AppleScript version. Refer to the ReadMe file for a summary of latest features. For help on the bundled tools and other features, consult the pull-down Help menu.

published on Saturday, the 24. May 2008, scriptbuilders

Sync or eject iPods/iPhones in iTunes via AppleScript

I find it frustrating that there's no quick and easy way to sync my iPod and iPhone in iTunes without a degree of mouse movement and clicking (someone please correct me if I'm wrong!). Since I'm a keyboard navigation fan, I wrote some very simple AppleScripts to either sync or eject all iPods/iPhones currently connected to iTunes. The scripts are identical apart from the type of action:Sync iPod.scpt:tell application "iTunes" repeat with s in sources if (kind of s is iPod) then update s end repeatend tellEject iPod.scpt:tell application "iTunes" repeat with s in sources if (kind of s is iPod) then eject s end repeatend tellI personally have these scripts in my user's Library/Scripts folder, and use Quicksilver to quickly invoke them when I want to force a sync or eject of my iPod/iPhone.

published on Friday, the 25. April 2008, macosxhints

Toggle Character Palette and Keyboard Viewer on/off

This hint will let you toggle the state of the Character Palette and Keyboard Viewer via AppleScript and a hot key -- activate and hide the panels just by pressing their assigned hot keys. I'll use Proxi for the hot key assignments, but the AppleScripts should work with any such program -- Spark, Keyboard Maestro, Quickeys, Butler, etc. (This hint is similar to this earlier hint, but provides a toggle functionality and works in 10.5.)Install Proxi, then open the Proxi Editor. Choose Insert Trigger » Hotkey Monitor from the Action menu beneath the Triggers portion of the Proxi Editor window (or drag it in there from the Components window). Replace the selected text (Hotkey Monitor) in the new Trigger with Toggle Character Palette. Click Set in the right half of the Editor window. Press Control-~ (tilde), or the key combination o...

published on Wednesday, the 2. April 2008, macosxhints

Run scripts via the Script Menu via keyboard

I work with image files and I have many scripts and Automator workflows to handle and modify them. Lots of these actions are assigned to Quicksilver keyboard shortcuts, as I hate using the trackpad. Unfortunately it's difficult (for me) to remember all the keys, and I'm also running out of keyboard! So this tip assigns a keyboard shortcut to the script icon in the menu bar, and allows you to easily select the scripts/workflows within by keyboard. It will work with most apps. First, open AppleScript Utility in /Applications » AppleScript, and activate Show Script Menu in menu bar and Show application scripts at: top. Then, holding Command, drag the Script icon in the menu bar as far left as you can (it won't go past certain installed apps' icons). Next, in the Keyboard Shortcuts tab of the Keyboard & Mouse System Preferences panel, enable (and change if desired) the shortcut for Move focus to status menus in the menu bar (in the Keybo...

published on Friday, the 21. March 2008, macosxhints

RemoveWork 1.0

Remove Work Menu Items easily using this applescript. A keyboard shortcut can be easily set up using the name of the script in Keyboard Shortcut System Preferences.

published on Tuesday, the 19. February 2008, scriptbuilders

10.5: Use Caps Lock to send keystrokes via AppleScript

I finally had that eureka moment, on how to detect Caps Lock using Applescript, while trying to help out on this forum thread about auto-logging out from a Mac.The Applescript calls KeyboardViewerServer.app, and checks the value of the CAPS key via the Keyboard Viewer window. A return value of 1 means the Caps Lock key is down, and a return of 0 means it's up. The really strange -- but good -- thing is that even if the Keyboard Viewer window is not actually visible, the value still gets returned. (If it pops up the first time you run the script, just close its window). Here's a test script to demonstrate how it works:

published on Tuesday, the 12. February 2008, macosxhints