The script is part of a rule that takes a file that has been named with the format "FileName|NotebookName|tagName1|tagName2|" and puts it into Evernote, with the file name, notebook, and two tags all lined up. Now, I get nothing (and nothing of value in the log, in debug or otherwise).
I've searched, and came up with a couple of things something that I thought were possibilities,
1.change the line
tell application "Evernote"
to
tell application id "com.evernote.Evernote"
2. change the line
create note from file theFile ...
to
set theNote to create note from file theFile ...
I tried that these each (singly and in combination) and it did not make any difference. Any other things to try?
- Code: Select all
tell application "Finder"
set myTokens to name of theFile -- get the filename which includes the tokens I'm going to use as tags
try
set oldDelims to AppleScript's text item delimiters -- save their current state
set AppleScript's text item delimiters to {"|"} -- declare new delimiters used in filename
set name of theFile to text item 1 of myTokens & ".PDF" -- contains the name
set book to text item 2 of myTokens -- contains the notebook
set tag1 to text item 3 of myTokens -- contains the type
set tag2 to text item 4 of myTokens -- contains a tag
tell application "Evernote"
activate
create note from file theFile notebook {book} tags {tag1, tag2}
end tell
set AppleScript's text item delimiters to oldDelims -- restore them
on error
set AppleScript's text item delimiters to oldDelims -- restore them in cases where something went wrong
end try
end tell