-
-
Save program247365/181291 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment