

GeekTool is a great way to display the results of little scripts on your desktop. Here’s how to do it with Python and GeekTool.Ī script to convert a TaskPaper file to XML so as to filter it for specific tags and display the results on the Desktop. But sometimes you just want to know if the time is today, or yesterday, or two days ago. There are a lot of desktop clocks that show the absolute time. Put a relative clock on your Desktop with GeekTool Rather than “tomorrow at time” use “time tomorrow”. More GeekTool icalBuddy and eventsFrom/toĪli Rantakari’s icalBuddy has an error in the documentation for the “eventsFrom/to” command-line option. However, this is possible in Automator and while it adds complexities it can also solve problems such as wanting to save dropped filenames for later use.ĪppleScript can be run from the shell pretty much like any other shell scripting language-it doesn’t even always need a logged-in user.ġ5 more pages with the topic AppleScript, and other related pages By its nature it is very procedural: one task follows another workflows don’t loop and they don’t store variables for later. Use Applescript to append a parenthetical to the titles of all selected photographs in Photos on macOS.ĪppleScript, variables, and dropped filenames in AutomatorĪutomator is a simple workflow system for Mac OS X. Use the Finder toolbar to save text on the current clipboard directly to a file in the folder that Finder window is displaying.Īdding parenthetical asides to photograph titles on macOS Save clipboard text to the current folder More AppleScript Using version control with AppleScriptsĪppleScripts aren’t stored as text, which makes it impossible to track changes in AppleScript files using version control software such as Mercurial or Git. March 28, 2011: AppleScript, Mail, and deleted messages If you do want to work more closely with iCal, you may find icalBuddy useful. Something like “messages of inbox sorted by descending date received” would be nice.Īnother nice thing about this, is that I don’t need a separate geeklet for iCal, since iCal emails me anything important and the email lands on the Desktop as soon as I decide not to delete it (or doesn’t land on the Desktop if I do choose to delete it). I also don’t see a way of specifying the order of the messages (without changing their order in the mailbox, and I don’t want the script to interfere with my inbox).If I want to act on something, I need to move it into my inbox. This means that my old trick of flagging messages and using a smart mailbox to collect important messages all in one place isn’t as useful. There does not, in fact, appear to be any way to select smart mailboxes. There does not appear to be any way of getting all flagged messages, even through a smart mailbox.That would make the results more readable. It would be nice if GeekTool could set tab stops.It’s a tossup, but currently I’m using Mac OS Roman because editing AppleScript outside of AppleScript Editor is painful, and I don’t use AppleScript enough to justify buying a third-party editor dedicated to AppleScript. UTF-8 is better for tracking in Mercurial and provides more bullet options AppleScript Editor is better for AppleScript. You can run that line on the command line, too.ĪppleScript Editor does not support UTF-8, only, as far as I can tell, Mac OS Roman however, the osascript command does. /usr/bin/osascript ~/bin/Inbox.applescript.It uses a neat trick that Mail can do, which I learned from Rob de Jong at MacWorld hints, which is to “extract name from” an address line you can also “extract address from” it works with any text that looks like a To or From line. And finally, it converts that list to text.

It compiles an array of lines with the bullet, the subject, and the sender’s name if it can find it. I’ll sometimes use the flag to remind myself that, hey, this is the one you want to do next. If the message is flagged, it uses a right-pointing double angle as the bullet, otherwise it uses a standard bullet. Then it tells each message to get information about itself. It’s fairly simple: it tells the Apple Mail application to get all “messages of Inbox whose read status is true”, i.e., all messages that have been read and are in the inbox. copy bullet & senderName & tab & subject & linefeed to end of messageList.set senderName to extract address from sender.-if there is no name, or the address line is malformed, better to show just the address.set senderName to extract name from sender.Repeat with pendingMessage in (messages of inbox whose read status is true)
