Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Backup automatico ogni settimana (applescript):
- -- FONTE https://discussion.evernote.com/topic/80581-backup-individual-notebooks-with-this-applescript/
- with timeout of (30 * 60) seconds
- tell application "Finder"
- set dateString to (current date) as text -- get the date
- set {year:y, month:m, day:d} to (current date)
- set newDatestring to (y * 10000 + m * 100 + d) as text
- --
- set baseBackupFolder to "/Users/YOURDESTINATIONPATH/BK-evernote/"
- set setBackupfolder1 to baseBackupFolder as POSIX file
- set dataOggi to (newDatestring) as text
- make new folder at setBackupfolder1 with properties {name:dataOggi}
- set setBackupfolder to baseBackupFolder & dataOggi & "/" as POSIX file
- -- confirm valid path exists
- if setBackupfolder exists then
- else
- display dialog "The backup path you set does not exist. Please go to line 3, set a valid path and re-run this script." giving up after 99999999
- error number -128
- end if
- set backupFolder to setBackupfolder as text
- end tell
- -- activate evernote
- tell application "Evernote"
- activate
- -- wait for evernote to come to the front
- tell application "Finder"
- set frontAppname to "whatever"
- repeat while frontAppname is not "Evernote"
- tell application "System Events" to set frontAppname to name of first process where frontmost is true
- end repeat
- delay 1 -- wait a little more
- end tell
- -- do the backup
- set allNotebooks to every notebook
- repeat with currentNoteBook in allNotebooks
- set notebookName to (the name of currentNoteBook)
- set allNotes to every note in notebook notebookName
- if every note in notebook notebookName exists then -- proceed if notebook is not empty
- (*
- set exportFilename to (backupFolder & notebookName & " - Backed up on " & newDatestring & ".enex")
- *)
- set exportFilename to (backupFolder & notebookName & ".enex")
- export allNotes to exportFilename
- end if
- end repeat
- -- confirmation dialog
- display dialog "The backup of your Evernote notebooks is complete." buttons {"View Backup Folder", "OK"} default button 2 giving up after 99999999
- if the button returned of the result is "View Backup Folder" then
- tell application "Finder"
- activate
- open backupFolder
- end tell
- end if
- end tell
- end timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement