Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to export all Stickies as text' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to export all Stickies as text
Authored by: ducasi on May 18, '12 07:10:33AM
Here's a revised version of this script which copes with notes which have quotes and other "special" characters which can cause the original script to fail.

set theName to ""
set i to 0
set n to {}
set L to {}

set destFldr to (choose folder with prompt "Choose a destination folder:") as text
set mydestFldr to POSIX path of destFldr

tell application "Stickies"
	activate
	tell application "System Events"
		tell application process "Stickies"
			set L to name of every window
			try
				repeat with awindow in L
					set m to value of text area 1 of scroll area 1 of window awindow
					set i to i + 1
					set theName to "stickies" & "_" & i & ".txt" as string
					set theFile to mydestFldr & theName
					do shell script "/bin/echo " & quoted form of m & " > " & quoted form of theFile
				end repeat
			end try
		end tell
	end tell
	display dialog "done"
end tell


[ Reply to This | # ]