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

An AppleScript to export all Stickies as text Apps
As you may know, Stickies isn't scriptable except through System Events. There is a menu item to export the text from a Sticky, but there is no command to export all Stickies to a text file at once. Hopefully, one day Apple will implement this function.

Until that day, though, here is a script that will allow you to export the text from all of your Stickies. A text file will be created for each Sticky that you have created. With all of your Stickies exported, you can search the exported Stickies via Spotlight, which is currently not possible unless you know how to build a stickies plug-in for Spotlight (which doesn't appear to be easy). It will not export images or movies; perhaps I will create a script that can extract images or movies if someone else doesn't beat me to it.

I saved the script as an application and placed it in the Dock for whenever I need to export all my stickies.

[robg adds: This works as described; when you run it, you'll get a dialog asking where you'd like the exported notes to be saved. Choose a folder, and very quickly, the export will be done.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[18,140 views]  

An AppleScript to export all Stickies as text | 18 comments | Create New Account
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: osxpounder on Feb 07, '06 06:59:45AM

I'm sorry to report that it fails for me after saving 5 to 7 Stickies [of my total of 22 Stickies notes]. I find it curious that the number of files it manages to create isn't exactly the same, each time I try.

---
--
osxpounder



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: myhd on Feb 07, '06 08:30:15AM

Does not work here, either. Managed to export zero of nine notes. No embedded images or other binary stuff. Hmm. Any ideas?



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: roncross@cox.net on Feb 07, '06 11:06:02AM

What kind of error did you get? Are you running Tiger on Mac OS X 10.4.4?

thx
RLC

---
rlc



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: myhd on Feb 08, '06 01:41:15AM

Hi,

No error, just no files got saved. Running 10.4.4 -- German is set as UI language (interestingly, even though "Stickies" is called "Notizzettel" in the localized version, the *process* name (see your script) is still "Stickies") .... hope this helps!



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: roncross@cox.net on Feb 08, '06 05:48:46PM

Sorry I am not able to help in this regards. I didn't test my script against other languages and in fact I always assume that these scripts were transparent to different languages- I guess I am wrong. Maybe someone else may be able to offer some advice in this area.

thx
RLC

---
rlc



[ Reply to This | # ]
No files exported
Authored by: foop on Mar 27, '06 09:07:10AM

Nothing is exported (no files written) for me when I run this script. Best I can tell from the AppleScript log, the script is unable to get any window names:

tell application "System Events"
get name of every window of application process "Stickies"
{}
end tell

I'm running 10.4.5. Anyone else see this behavior?



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: muzak75 on Feb 07, '06 09:39:08AM

This may be painfully evident, but you can also export all your stickies by saving as a PDF in the Print dialog. Exports the images as well and text is selectable for copy/paste operations. Of course, it's not as easy to export them separately, since it saves either one or all in one PDF, depending on the options you select.

Anyway, it worked for me. I just needed a backup of the info in all of my stickies and got it quickly that way...



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: eddy_k on Feb 07, '06 10:26:35AM

I didn't know it was possible to print all notes... And just open the pdf file in Textedit and I am all done!
Nice.



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: roncross@cox.net on Feb 07, '06 11:01:31AM

How do you import them back into stickies if you need to use them again?

thx
RLC

---
rlc



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: mark hunte on Feb 07, '06 01:08:51PM

use the import menu.

One thing with this is, if your sticky is rich text of rtfd

then it will be stripped to plain text.



---
mh



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: roncross@cox.net on Feb 07, '06 01:40:51PM

I was referring to how you import them back from pdf into stickies? When you do this, you lose some of the formatting. Plus it will not parse out the stickies.

thx
RLC

---
rlc



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: muzak75 on Feb 07, '06 04:27:59PM

It's definitely not the best way, but you can select the text from the PDF and copy/paste it into a new note. Haven't really had the need to import them yet...

Anyone else?



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: ccgaudette on Feb 07, '06 09:08:09PM

Interesting. Using Mac OS X 10.4.4 here, I can only print to PDF the first 44 notes -- using the "Print All Notes..." function. I have roughly 100 notes, each note is collapsed to just the title bar and sorted by color, and as it turns out sub-sorted by alpha.



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: bbh on Feb 08, '06 02:03:58PM

Yes, Like an earlier poster, I found that Stickies will output a PDF file of all your stickies through the Print Dialog. Spotlight WILL search through the PDF file to locate the particular info you need.



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: dave1212 on Feb 09, '06 12:33:22AM

only does the first bunch of notes, doesn't do them all. I end up with 10 pages of notes and 30 blank pages.



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: Avi.1981 on May 05, '12 05:39:52PM

I got this error

error "System Events got an error: Access for assistive devices is disabled." number -1728 from every window of application process "Stickies"

Please help. OS version: 10.7.2



[ Reply to This | # ]
An AppleScript to export all Stickies as text
Authored by: ducasi on May 18, '12 07:06:14AM

You need to turn on "Enable access for assistive devices" in the Universal Access System Preferences.



[ Reply to This | # ]
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 | # ]