MAC-Evernote Developer

Source: Internet
Author: User

  using Evernote on your Mac, you can use AppleScript to write scripts, automate the creation of notebooks and notes quickly, and use code logic to create bulk operations, such as multiple files that are typically encountered in folders that need to be created into a corresponding notebook that is imported into Evernote.   Below is a sample of the reference AppleScript code given on the Evernote development site.  --This script includes examples for using AppleScript to perform several --useful tasks with evernote. - -Each section illustrates a chunk of Evernote's AppleScript interface, --and each sections also cleans up after Itse lf. --refer to the Evernote application ' s scripting dictionary for --detailed information and being Carefu L:operations that would normally --confirmation from the user (such as deleting notes, etc) are --completed W Ithout warning when invoked from Applescript! tell application "Evernote"--Create, rename, and delete Notebooksif (n OT (notebook named "AppleScriptNotebook1" exists)) then--NOTE Also check out the "Create Notebook" Commandmake notebook W ITH Properties {name: "AppleScriptNotebook1"}end ifset name of Notebook "AppleScriptNotebook1" to "AppleScriptNotebook2" --WARNING There is no Confirmation!delete notebook "AppleScriptNotebook2"--------------------------------------Create , rename, and delete tagsif (not (tag named "AppleScriptTag1" exists)) Thenmake tags with properties {name: "AppleScriptTag1 "}--Create a Sub-tagmake tag with properties {name:" AppleScriptTag2 ", Parent:tag named" AppleScriptTag1 "}end ifset name O F Tag "AppleScriptTag1" to "AppleScriptTag3"--WARNING there was no confirmation, and all subtags are deleted as Well!delet E tag "AppleScriptTag3"--------------------------------------Create notes, four ways--1:with plain Textset Notebook1 to Create Notebook "AppleScriptNotebook1" Create note title "Note 1" with the text "Here is my new text note" Notebook notebook1- -2:with htmlcreate Note title "NOTE 2" with HTML "<strong>here is my new HTML note</strong>" notebook Notebo ok1--3:with the data from a urlcreate note title "Note 3" from URL "http://www.evernote.com/media/images/logo.png" Noteb Ook notebook1--4:with theData from a filecreate note title "Note 4" From file "/path/to/a/file.txt" notebook notebook1--cleanupdelete Notebook1--- -----------------------------------move note between notebookscreate notebook "AppleScriptNotebook1" Create Notebook " AppleScriptNotebook2 "Create note title" Note 1 "with text" Moving note "notebook" AppleScriptNotebook1 "move note 1 of note Book "AppleScriptNotebook1" To Notebook "AppleScriptNotebook2"--Cleanupdelete Notebook "AppleScriptNotebook1" delete Notebook "AppleScriptNotebook2"--------------------------------------Delete individual notescreate notebook " AppleScriptNotebook1 "Create note title" Note 1 "with text" delete this note! "notebook" AppleScriptNotebook1 "Delete Note 1 of notebook "AppleScriptNotebook1"--Cleanupdelete Notebook "AppleScriptNotebook1"--------------------------------- -----Assign, Unnasign tagscreate notebook "AppleScriptNotebook1" set Note1 to create note title "Note 1" with text "Note 1 "Notebook" AppleScriptNotebook1 "set Note2 to CreatE Note title "Note 2" with the text "Note 2" notebook "AppleScriptNotebook1" set Note3 to the Create note title "Note 3" with text "Note 3" Notebook "AppleScriptNotebook1" set Tag1 to do tag with properties {name: ' AppleScriptTag1 '}set tag2 to make tag With properties {name: ' AppleScriptTag2 ', Parent:tag named "AppleScriptTag1"}set tag3 to make tag with properties {name: "Ap PleScriptTag3 ", Parent:tag named" AppleScriptTag1 "}assign Tag1 to Note1assign {tag2, tag3} to {note2, note3}unassign Tag1 From note1unassign {tag2, tag3} from {note2, note3}--cleanupdelete notebook "AppleScriptNotebook1" delete tag "AppleScrip TTag1 "--------------------------------------Open a note in it own Windowset Notebook1 to create notebook" Applescriptnot Ebook1 "Set Note1 to create note with text" Note 1 "Notebook Notebook1open note window with note1--cleanupdelay (3)--Wai T to be sure new window have openedclose window 1delete notebook1--------------------------------------Change the query us Ed in a note collection Window--(assumes the default Note collection window is open and was Window 1) Set Notebook1 to create notebook "APPLESCRIPTN Otebook1 "Set Note1 to create note with text" Only me! "notebook notebook1set query string of Windows 1 to" Notebook:applesc RiptNotebook1 "--cleanupdelete notebook1--------------------------------------Open a new collection window with a Specific Queryset Notebook1 to create notebook ' AppleScriptNotebook1 ' set note1 to ' Create note with text ' only me! ' Noteboo K Notebook1open Collection window with query string "Notebook:applescriptnotebook1"--cleanupdelay (3)--wait for Be sure New window has openedclose window 1delete notebook1--------------------------------------append data to a noteset Noteboo K1 to create notebook ' AppleScriptNotebook1 ' set note1 to create note with text ' foo ' notebook Notebook1tell note1 to Appen D html "<strong>bar</strong>" Tell Note1 to append text "Baz"--cleanupdelete Notebook1--------------------------------------Execute a queryand manipulate every note in the result--for details on the query syntax, see our Search Grammar overview--at Http://dev . Evernote.com/documentation/cloud/chapters/search_grammar.phpset Notebook1 to create notebook "AppleScriptNotebook1 "Set Note1 to create note with text" An apple was a fruit "notebook notebook1set note2 to create note with the text" an Apple I s a computer "notebook Notebook1set note3 to create note with the text" an orange was a fruit "notebook notebook1set note4 to C reate note with the text "an Amiga was a computer" notebook Notebook1set tag1 to make tags with properties {name: "Applescripttag 1 "}set matches to find notes" Notebook:applescriptnotebook1 Apple "assign Tag1 to matches--cleanupdelete tag1delete Notebo Ok1--------------------------------------do something with the application ' s selected Notesset Notebook1 to create Noteb Ook "AppleScriptNotebook1" set Note1 to the Create note with the text "Note 1" notebook Notebook1set note2 to the Create note with text "Note 2" notebook Notebook1open Collection window with query string "Notebook:applescriptnotebook1" set Tag1 to make tag with properties {name: "AppleScrip TTag1 "}delay (3)--is sure the new window has opened--normally, a script would is activated to take action when the user had--made a selection, rather than this artificial demonstrationset notelist to selectionassign Tag1 to notelist--Note: The application's ' selection ' property returns the same result as--the selection of Windows 1, if any--cleanupclose wind ow 1delete Tag1delete Notebook1--------------------------------------refer to the Evernote application ' s Scripting dictionary--for complete details on the Evernote AppleScript interfaceend tell

Mac-Evernote developer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.