Evernote tag from attribute input

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Evernote tag from attribute input Wed Aug 08, 2018 2:47 am • by alephtaph@gmail.com
Hi everyone

I have a embedded apple script to import my pdf to Evernote, it workes great and I get the import done. Now with the option to use the atributes, it opens new doors. It would be great to use the date as a tag in Evernote.

Here is my script so far:
tell application “Evernote”
activate
create note from file theFile notebook “01 Inbox”
tag {“bill”, “>assura”, “>marco”}
end tell

How can I include the atributes in the tags?

I tried this:
tell application “Evernote” activate
create note from file theFile notebook “01 Inbox”
tag {“leistungsabrechnung”, “>assura”, “>marco”, item 1 of inputAttributes}
end tell

But now no tags are applied.

Is there a way to get parts of the date as a tag? ie: the year and the month?

Thanks for the help.
Marco
alephtaph@gmail.com
 
Posts: 9
Joined: Thu Mar 01, 2018 5:07 pm

Re: Evernote tag from attribute input Wed Aug 08, 2018 11:12 am • by Mr_Noodle
Did you specify an attribute to be passed in? In the UI, there's an editor where you can specify which attributes to pass in (and which the script will pass back out).
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Hi Mr_Noodle

Yes I tried that but again no output. But I found a other error, I needed to use Tags not Tag. But I still got no output.

tell application "Evernote"
activate
create note from file theFile notebook "01 Inbox" tags {"zahlungsbestätigung", ">postfinance", ">wwz", item of attributes}
end tell

2018-08-09 20:17:53.844 hazelworker[40815] ###main load address: 0x1009ef000
2018-08-09 20:17:53.847 hazelworker[40815] ###Noodle load address: 0x100b17000
2018-08-09 20:17:53.847 hazelworker[40815] ###CK load address: 0x100ad8000
2018-08-09 20:17:53.886 hazelworker[40815] Processing folder Belege (forced)
2018-08-09 20:17:58.759 hazelworker[40815] CRE_P_CH1709000000304024612_1106601694_0_2018072709462934.pdf: Rule z_Zahlungsbestätigung WWZ matched.
2018-08-09 20:17:58.762 hazelworker[40815] [File Event] File renamed: /Users/marco/Dropbox/10_m&m/Finance/Belege/CRE_P_CH1709000000304024612_1106601694_0_2018072709462934.pdf renamed to /Users/marco/Dropbox/10_m&m/Finance/Belege/2018-07-27 - zahlungsbestätigung wwz.pdf.
2018-08-09 20:17:59.006 hazelworker[40815] [Error] AppleScript failed: Error executing AppleScript on file /Users/marco/Dropbox/10_m&m/Finance/Belege/2018-07-27 - zahlungsbestätigung wwz.pdf.
2018-08-09 20:17:59.025 hazelworker[40815] OSAScript error: {
NSLocalizedDescription = "The variable attributes is not defined.";
NSLocalizedFailureReason = "The variable attributes is not defined.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: null()>";
OSAScriptErrorBriefMessageKey = "The variable attributes is not defined.";
OSAScriptErrorMessageKey = "The variable attributes is not defined.";
OSAScriptErrorNumberKey = "-2753";
OSAScriptErrorOffendingObjectKey = "<NSAppleEventDescriptor: 'utxt'(\"attributes\")>";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
2018-08-09 20:17:59.058 hazelworker[40815] Received abort event.
2018-08-09 20:18:01.067 hazelworker[40815] Received abort event.
2018-08-09 20:18:01.069 hazelworker[40815] Done processing folder Belege
alephtaph@gmail.com
 
Posts: 9
Joined: Thu Mar 01, 2018 5:07 pm

Re: Evernote tag from attribute input Fri Aug 10, 2018 10:57 am • by Mr_Noodle
It should be "inputAttributes" (you had it right in the first script), not "attributes". Try fixing that.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Sorry for the late response. I got en error:

2018-08-18 17:54:42.595 hazelworker[82814] CRE_P_CH1709000000304024612_1106601694_0_2018072709461717.pdf: Rule z_Zahlungsbestätigung Tierarzt Wolfisberg matched.
2018-08-18 17:54:42.598 hazelworker[82814] [File Event] File renamed: /Users/marco/Dropbox/10_m&m/Finance/Belege/CRE_P_CH1709000000304024612_1106601694_0_2018072709461717.pdf renamed to /Users/marco/Dropbox/10_m&m/Finance/Belege/2018-07-27 - zahlungsbestätigung tierarzt wolfisberg.pdf.
2018-08-18 17:54:42.892 hazelworker[82814] [Error] AppleScript failed: Error executing AppleScript on file /Users/marco/Dropbox/10_m&m/Finance/Belege/2018-07-27 - zahlungsbestätigung tierarzt wolfisberg.pdf.
2018-08-18 17:54:42.900 hazelworker[82814] OSAScript error: {
NSLocalizedDescription = "Evernote got an error: Can\U2019t make {\"zahlungsbest\U00e4tigung\", \">postfinance\", \">dr. wolfisberg\", date \"Friday, 27 July 2018 at 12:00:00\"} into type list of text or list of tag.";
NSLocalizedFailureReason = "Can\U2019t make {\"zahlungsbest\U00e4tigung\", \">postfinance\", \">dr. wolfisberg\", date \"Friday, 27 July 2018 at 12:00:00\"} into type list of text or list of tag.";
OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,5cb5cb \"Evernote\"]>";
OSAScriptErrorAppNameKey = Evernote;
OSAScriptErrorBriefMessageKey = "Can\U2019t make {\"zahlungsbest\U00e4tigung\", \">postfinance\", \">dr. wolfisberg\", date \"Friday, 27 July 2018 at 12:00:00\"} into type list of text or list of tag.";
OSAScriptErrorMessageKey = "Evernote got an error: Can\U2019t make {\"zahlungsbest\U00e4tigung\", \">postfinance\", \">dr. wolfisberg\", date \"Friday, 27 July 2018 at 12:00:00\"} into type list of text or list of tag.";
OSAScriptErrorNumberKey = "-1700";
OSAScriptErrorOffendingObjectKey = "<NSAppleEventDescriptor: [ 'utxt'(\"zahlungsbest\U00e4tigung\"), 'utxt'(\">postfinance\"), 'utxt'(\">dr. wolfisberg\"), 'ldt '($C0B980D700000000$) ]>";
OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
2018-08-18 17:54:44.259 hazelworker[82814] Received abort event.
2018-08-18 17:54:46.271 hazelworker[82814] Received abort event.
2018-08-18 17:54:46.274 hazelworker[82814] Done processing folder Belege

So the file was not even imported in Evernote.
alephtaph@gmail.com
 
Posts: 9
Joined: Thu Mar 01, 2018 5:07 pm

Re: Evernote tag from attribute input Mon Aug 20, 2018 10:23 am • by Mr_Noodle
Have you tried the script outside of Hazel. It's having a problem with the tag list's type. I suggest trying it in Script Editor and debugging it there.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support