Keep auto-timeout Transmit connections alive
I use a shared host which unfortunately, due to circumstances outside my control, terminates my Transmit FTP/SQL sessions after 15 minutes of idleness. Good for processor cycles, poor for my sanity, especially during intensive coding/research sessions. After gleaning the internet for a solution and finding none which worked, I decided to whip up my own. Copy and paste the following code into Script Editor, and save it as an application with the 'stay open' option checked:repeat tell application "Transmit" tell document 1 tell current session refresh list their stuff files end tell end tell end tell delay (60)end repeatIf anyone wants to follow up this with a touch of AppleScript that cycles through every connection, that would be great. This is my first AppleScript project, so woot for me!
published on Thursday, the 23. October 2008, macosxhints
Print PDFs directly to iPod touch (and iPhone)
I frequently want to print copies of maps, directions or other things to take with me on the road. Since I found the app Air Sharing for my iPod touch, I can save the docs to PDF, and then copy them to my iPod touch for offline viewing. I put together an Automator workflow [65KB download] that allows me to do this directly from the print dialog box. To configure the workflow, put the (unzipped) downloaded file into the /Library/PDF Services folder. Open the workflow in Automator, and then set the IP address of your iPod touch or iPhone in the first line of the AppleScript action, and set the save to location in the last action to the desired location on your iPod touch/iPhone. (Note that you need to have the iPhone/iPod touch mounted via Air Sharing to use this workflow.) Finally, save the workflo...
published on Tuesday, the 30. September 2008, macosxhints
Add an iPhone call log to iCal via AppleScript
If you're like me, it is often nice to know the time spent on a call (especially if you charge your services by the minute) and even though the cheapest cell phones out there can tell you the time you were just on the phone, that data is buried deep in iPhone's records and unaccessible from the touch GUI. I have been using a script created in ruby called calllog2ical, which you can download from this page at Google Code. The install process is a breeze and it can be called from Terminal. After using the script for about a week, I decided it would be nicer to use an AppleScript to access the shell script, and so I wrote one. Its all of one line and goes like this: do shell script "/usr/local/bin/calllog2ical.rb -v0 iPhone\\ Call\\ Log" In the above code, the calendar I am syncing to is iPhone Call Log. Notes: In order to get the AppleScript ...
published on Tuesday, the 26. August 2008, macosxhints
10.5: Clear Download stack via an overlay icon
I hate how stacks only allow you to drag one file at a time out of them, so I decided to combine some earlier hints into a solution. By combining the overlay icons discussed here with this AppleScript, I've created an overlay icon for the Downloads folder [84KB download] that actually performs a helpful function: it empties the stack if you select it! To add the ability to sort by date modified as well as by name, open Terminal, cd to the correct folder and then, assuming you haven't changed the name of the AppleScript, just type this: touch -mt 202001010101.01 " Downloads .app" [robg adds: I haven't tested this one -- note that thi...
published on Friday, the 21. December 2007, macosxhints
Completely disable trackpad touches while typing
Have you been frustrated with how the slightest touch on the trackpad causes the text cursor to jump to a different line when you're typing away, especially when you're in mid-thought and wanted to capture everything? (This only applies, of course, if you've enabled trackpad clicking.) Have you been even more frustrated when the Ignore accidental trackpad input setting within the Keyboard & Mouse preferences still doesn't work 100% of the time? I've been very frustrated with that, and went looking for a Mac Gem or AppleScript that would allow me to disable the trackpad with a keyboard (similar to the PC laptops that have an extra button near the trackpad). I couldn't find anything out there (yet), but as it turns out, Apple has something built-in that allows you to accomplish something very close. And surprisingly, it's actually very effective. Just visit the Universal Access System Preferences panel, click on the Mouse & Trackpad tab, and enable...
published on Wednesday, the 5. December 2007, macosxhints
One way to sync Address Book smart groups to iPods etc.
I got my iPod touch last week, and I realized that, even if it can sync my contacts and groups correctly from Address Book, it cannot sync smart groups. While it is possible to manually copy contacts from a smart group to a standard group, that is boring.So, I decided to get myself to AppleScript, and built a little script that will help. For the script to work, it is simple: create your smart group and call it, let's say, SMyGroup (The "S" before meaning smart; otherwise name the group as you want). Built the smart group conditions to make it work the way you need. Then create a standard group called MyGroup. So you have two groups with similar names, with only a "S" in difference. That is necessary because I couldn't figure out how to distinguish smart from standard groups in Address Book via script. Then use this script:tell application "Address Book" repeat with the_person in every person in group "SMyGro...
published on Monday, the 15. October 2007, macosxhints
10.4: Set a photo file's creation date to the photo's date
A fellow user in another (German) Forum asked for a way to change a photo file's creation date to the date the picture was taken. We also found out that touch also changes Mac OS X's creation date, provided that it's prior to the file's creation date. After a lengthy (German) discussion, I've created an AppleScript (see source links below) that takes care of (I hope) almost all possible cases:If the photo's date is prior to the file's date, a simple touch is done.If the photo's date is prior to today's date, the photo file is copied, so it gets today's date. Then it is touched.Otherwise you have a picture from the future and I'd like to meet you soon ;-) No.. .The script complains and suggests you fix your time settings. The script is usable in three ways:Standalone: You will...
published on Friday, the 5. January 2007, macosxhints
Brilliant Browsin' 0.6
Have a song playing or selected and want to see all tracks of the same genre / artist or album At a touch of a button Then this is your script! Will not work 'out of the box' on non-english versions of iTunes. Read the code for further explanations. You might need to do some hard-coding. see http://applescript.flimmerrausch.com for more AppleScripts for iTunes
published on Sunday, the 26. November 2006, scriptbuilders
A script to sort the Downloads folder by download date
I like to have a Downloads folder with files sorted by download date. However, I have not found this option in OS X, because the files' dates are not modified on download. So I modified a small script that updates the modification date of files. Attach this AppleScript to your download folder via Folder Actions, and now you only have to put the folder in list mode, and sort by modification date. Hope it helps. on adding folder items to this_folder after receiving added_items repeat with file_ in added_items tell application "Finder" set file_ to POSIX path of file_ do shell script "touch -c " & quoted form of file_ end tell end repeat end adding folder items to The problem I have found with this is that you lost the real modification date, but sometimes this is a secondary issue. Perhaps the script can be modified to save the modification date in the notes field. [robg adds: Back in 2003, we ran ...
published on Wednesday, the 15. November 2006, macosxhints