Return to Snippet

Revision: 16673
at August 12, 2009 04:48 by 4fthawaiian


Initial Code
set snf to "echo" & " "
set theName to ""
set exportallstickies to "> "
set i to 0
set n to {}
set L to {}
set destFldr to ""

set mydestFldr to ""

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

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 end of n to m
        end repeat
      end try
      try
        repeat with acontent in n
          set i to i + 1
          set theName to "stickies" & "_" & i as string
          set x to item i of n
          do shell script snf & "\"" & x & "\"" & " " & exportallstickies ¬
            & "\"" & mydestFldr & "\"" & theName & ".txt"
        end repeat
      end try
    end tell
  end tell
  display dialog "done"
end tell

Initial URL
http://www.macosxhints.com/dlfiles/stickies_export_scpt.txt

Initial Description


Initial Title
Applescript Export Stickies to txt files

Initial Tags


Initial Language
AppleScript