Jump to content

victor50

Level 2
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

1 Neutral

About victor50

  1. Well, I've only hacked my original script and here it is what I think you want (remember to modify EVTag and MyNotebook according to your needs). It's by far simpler than the original case! Ciao from Rome, Italy -- -- Created by: Vittorio De Martino -- Created on: 11/27/12 15:39:27 -- -- on adding folder items to theFolder after receiving theNewItems -- Called after items have been added to a folder -- -- theFolder is a reference to the modified folder -- theNewItems is a list of references to the items added to the folder set myfile to (get info for item 1 of theNewItems) set DestFile to (theFolder as string) & (name of myfile) as alias set MyTitle to (name of myfile) -- -- PUT HERE YOUR WANTED TAG set EVtag to "Filemaker" (*SET YOUR NOTEBOOK*) set MyNotebook to "Vittorio" tell application "Evernote" activate -- create note from file (DestFile as alias) title MyTitle notebook MyNotebook ¬ -- tags EVtag attachments (DestFile as alias) create note from file (DestFile as alias) title MyTitle notebook MyNotebook ¬ tags EVtag end tell end adding folder items to
  2. I noticed that the attached file in the new note is duplicated. To correct this, please substitute the line (see toward the end of code): create note from file (DestFile as alias) title MyTitle notebook MyNotebook ¬ tags EVtag attachments (DestFile as alias) with create note from file (DestFile as alias) title MyTitle notebook MyNotebook ¬ tags EVtag
  3. Absolutely no! With my old (2008) dual core white macbook using Lion it takes about 15 sec to arrive at the first request of the title when a new file is added and above all when the script has to start EN from scratch. Instead If EN is already active is a matter of seconds. Have you checked that EvernoteNewNoteFromFile.scpt is the only script to be fired when a new file is added?
  4. Well, I attached the file EvernoteNewNoteFromFile.scpt to my message but now I see that this file cannot be attached. Something went wrong! Anyway, here is the code of the same script that you should copy and past into the applescript editor, modifiy set MyNotebook to "Vittorio" as I said: --------------------------------------- -- -- Created by: Vittorio De Martino -- Created on: 09/27/12 15:39:27 -- -- on adding folder items to theFolder after receiving theNewItems -- Called after items have been added to a folder -- -- theFolder is a reference to the modified folder -- theNewItems is a list of references to the items added to the folder set myfile to (get info for item 1 of theNewItems) set DestFile to (theFolder as string) & (name of myfile) as alias (*SET YOUR NOTEBOOK*) set MyNotebook to "Vittorio" tell application "Evernote" activate set listOfTags to {} set EVTags to every tag --GET THE TAGS LIST repeat with currentTag in EVTags set currentTagName to (the name of currentTag) copy currentTagName to the end of listOfTags end repeat (*SORT THE TAGs LIST VIA BUBBLE SORT*) set last_swap_position to length of listOfTags repeat while last_swap_position is greater than 0 set comparisons_needed to last_swap_position - 1 set last_swap_position to 0 repeat with i from 1 to comparisons_needed if item i of listOfTags > item (i + 1) of listOfTags then set swap_item to item i of listOfTags set item i of listOfTags ¬ to item (i + 1) of listOfTags set item (i + 1) of listOfTags to swap_item set last_swap_position to i end if end repeat end repeat (*SET THE TITLE OF YOUR NOTE*) display dialog "Title of your note" default answer "" set MyTitle to the text returned of the result (*USER SELECTION FROM TAGs LIST *) set SelTag to choose from list of listOfTags with title "Select Tag" with prompt ¬ "Available Evernote Tags" OK button name "OK" set EVtag to item 1 of SelTag create note from file (DestFile as alias) title MyTitle notebook MyNotebook ¬ tags EVtag attachments (DestFile as alias) end tell end adding folder items to ------------------------------------------------------- As far as Library/Scripts/Folder Action Scripts is concerned, well, this is where I found it under 10.7 Lion. I don't know where they put it under Mountain Lion.
  5. In many occasions I have to scan a document and, unfortunately, I have to manually create a note in Evernote with that file as an attachment. I know that with Evernote for Mac OS X cannot define a folder to automatically import newly created files from (this instead is possible with Evernote for MS-windows). I've just finished writing an applescript code (called "EvernoteNewNoteFromFile.scpt"; see attachment) acting as an "Action Folder Script" that is it automatically starts as soon as a new file is created/moved into a specific folder. When this script is fired it creates a new note with a title, one (and only one) tag and attaches the file in the "automatic" folder to the note. When the script starts it asks the user only for a title and one (and only one) tag and automatically attaches the folder-newly-added file to the new EN note. To use this script you should: 1) Create the (not-yet automatic) folder 2) Copy EvernoteNewNoteFromFile.scpt into your home Library/Scripts/Folder Action Scripts (to go to Library click on Go in the Finder menu while pressing the Option/Alt key); 3) Open with the applescript editor EvernoteNewNoteFromFile.scpt and only modify the line: set MyNotebook to "Vittorio" with your notebook name. Save and close; 4) In Finder go to the not-yet automatic folder you've just created, right-click on it, and from the menu choose "Services->Folder Actions Setup" and combine the folder with EvernoteNewNoteFromFile.scpt. Now, your folder is an automatic folder that fires the script when a new file is added. That's all folk Ciao from Rome, Vittorio
×
×
  • Create New...