Skip to content

Instantly share code, notes, and snippets.

@sippey
Created September 3, 2009 00:53
Show Gist options
  • Save sippey/180057 to your computer and use it in GitHub Desktop.
Save sippey/180057 to your computer and use it in GitHub Desktop.
applescript for use with quicksilver to log text with date and timestamp

This is a simple AppleScript designed for use with QuickSilver to log text to a file with a date and timestamp.

Instructions for use...

  • Edit the script to set your file path appropriately. Mine is set to write output to my "log.txt" file in my "taskpaper" folder under Dropbox.
  • Open up script editor, paste in the script.
  • Save it to your ~/Library/Application Support/Quicksilver/Actions folder as something like LogIt.scpt. If the actions folder doesn't exist, go ahead and create it.
  • Restart Quicksilver.
  • Invoke Quicksilver, type ".", type your text, TAB, type "LogIt", hit enter. Voila, your text is appended to your log file with the date & timestamp at the beginning of the line.

For bonus points, set the "Open With..." setting on your log file to always open with the Console app. That way, when you view this file, you'll have quick access tools for filtering and searching through the file.

using terms from application "Quicksilver"
on process text log_text
set theDate to (do shell script "date '+%m-%d-%Y %H:%M'")
set theText to log_text
set theText to theDate & " " & theText & "
"
set thePosixFilePath to "/Users/msippey/Dropbox/taskpaper/log.txt" as string
set theFilePath to POSIX file thePosixFilePath
set theFileReference to open for access theFilePath with write permission
write theText to theFileReference starting at eof
close access theFileReference
end process text
end using terms from
@jmrepetti
Copy link

I've followed the howto and doesn't work for me. Where can I find a log file with errors? I've set permissions on script to 755. Should be simple, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment