Jump to content

Applescript not assigning tags - help!


Recommended Posts

Up until a couple of weeks ago I have been using for a long time Hazel and an applescript to automatically add files that are added to a specific folder on my computer to Evernote. When it added the note to Evernote it would add it to a specific notebook and assign specific tags. It worked fine for a past couple of years. For the past couple of weeks the script has been working fine except that it no longer assigns the tags. It adds the note to evernote and puts it in the correct notebook but does not assign the tag. Any idea why this has started happening and how I can fix it?

 

The applescript I use is:

 

tell application "Evernote"

activate

create note from file theFile notebook {"Notebook1"} tags {"Tag 1", "Tag 2"}

end tell

Link to comment
  • Level 5*

Hey guys - if you have an issue like this that appears to be linked to an update,  it's probably better to post your feedback in that version's release thread - you'll get the devs attention a bit quicker.  I posted a link to this thread there - https://discussion.evernote.com/topic/84362-evernote-for-mac-6012-6013-released/?p=362977

Link to comment

All, got word from Evernote support.

::This is a bug that should be addressed in the next release of Evernote. Until that time the tgs will have to be manually added to the note.::

Link to comment

This really sucks!!! I have like 150 Hazel rules that read OCR'd PDF files and automatically print, tag and file them in Evernote. I process about 100 doc's a day and the solution is "tag them by hand" ?? are they mad?!?!

When will this "new update" be launched? my workflow is now on hold and my work is piling up!!!

 

isn't there a working beta I can use?

Link to comment
  • Level 5*

isn't there a working beta I can use?

 

Be careful what you wish for.  Betas can be like getting out of the pan into the fire.   ;)

 

If you have an urgent need that can't wait for a fix in a production (GA) release, you might consider reverting to Ver 6.0.11.

If you are interested, see:

See How to Completely Remove and Reinstall EN Mac 

Link to comment
  • 2 weeks later...

Instead of:

create note from file theFile notebook {"NOTEBOOK"} tags {"tag1","tag2","tag3"}

try:

set theNote to create note from file theFile notebook {"NOTEBOOK"}repeat with theTag in {"tag1","tag2","tag3"}  assign tag theTag to theNoteend repeat
Link to comment

 

Instead of:

create note from file theFile notebook {"NOTEBOOK"} tags {"tag1","tag2","tag3"}

try:

set theNote to create note from file theFile notebook {"NOTEBOOK"}repeat with theTag in {"tag1","tag2","tag3"}  assign tag theTag to theNoteend repeat

 

 

Super @smaviglia, that works for me!!  Just rebuild all my scripts and everything is working again, now to get my work back on track.

 

@evernote, you can mark this as the solution if you ask me...

Link to comment
  • 1 year later...
  • Level 5*
On 7/13/2016 at 2:18 PM, Onesimus said:

This solution works not for me.

I have recently assigned tags to a new Note in the Create Note command, and it worked fine.

In order for us to help you, it would be best if you could post the script that is not working for you.

Link to comment

tell application "Evernote"

    activate

    create note from file theFile notebook {"10301 Gezin Fam JC Rosier"} tags {"10301", "2016"}

end tell

 

 

this script works , but as soon as synchronizing starts the tags disappear

Link to comment
  • Level 5*
37 minutes ago, Onesimus said:

tell application "Evernote"

    activate

    create note from file theFile notebook {"10301 Gezin Fam JC Rosier"} tags {"10301", "2016"}

end tell

 

 

this script works , but as soon as synchronizing starts the tags disappear

The script works for me, but I'd be concerned about this as a sync issue
It is not acceptable that "tags disappear"

Link to comment
  • Level 5*
3 hours ago, Onesimus said:

this script works , but as soon as synchronizing starts the tags disappear

What do you mean by "disappear"?

  1. The tags are no longer assigned to the note
  2. The tags don't exist in your account

What versions of macOS and Evernote are you running?

Link to comment

tell application "Evernote"

    activate

        set newNote

    create note from file theFile notebook {"10301 Gezin Fam JC Rosier"} assign tags to newNote {“10301", "2016"} 

end tell

 

I changed my apple script but this does nog work.

 

You gave me hope, perhaps is the syntax not right

 

 

Link to comment
  • Level 5*
11 minutes ago, Onesimus said:

tell application "Evernote"

    activate

        set newNote

    create note from file theFile notebook {"10301 Gezin Fam JC Rosier"} assign tags to newNote {“10301", "2016"} 

end tell

I think that should be

tell application "Evernote"
   activate
   set newNote to create note from file theFile notebook {"10301 Gezin Fam JC Rosier"}
   assign tags to newNote ....
end tell

Link to comment

I copied your writing and it failed.

 

I am not a programmer but i made a copy of the log of hazel 

2016-07-17 20:42:39.705 hazelworker[31860] 10301 test tags Applescript not assigning tags  help.pdf: Rule 10301✅verplaats naar evernote  10301 Fam JC Rosier matched.
2016-07-17 20:42:41.010 hazelworker[31860] [Error] AppleScript failed: Error executing AppleScript on file /Users/j.c.rosier/Dropbox/0 Evernote/10301 test tags Applescript not assigning tags  help.pdf.
2016-07-17 20:42:41.011 hazelworker[31860] OSAScript error: {
    NSLocalizedDescription = "Evernote got an error: Can\U2019t continue newNote.";
    NSLocalizedFailureReason = "Can\U2019t continue newNote.";
    OSAScriptErrorAppAddressKey = "<NSAppleEventDescriptor: [0x0,c40c4 \"Evernote\"]>";
    OSAScriptErrorAppNameKey = Evernote;
    OSAScriptErrorBriefMessageKey = "Can\U2019t continue newNote.";
    OSAScriptErrorMessageKey = "Evernote got an error: Can\U2019t continue newNote.";
    OSAScriptErrorNumberKey = "-1708";
    OSAScriptErrorRangeKey = "NSRange: {0, 0}";
}
2016-07-17 20:42:41.019 hazelworker[31860] Received abort event.
2016-07-17 20:42:43.034 hazelworker[31860] Received abort event.
2016-07-17 20:42:43.034 hazelworker[31860] Done processing folder 0 Evernote
2016-07-17 20:43:57.025 HazelHelper[430] Attempted to run worker on undeployed folder: /Users/j.c.rosier/Dropbox/0 Evernote.
I hope that you can read this and help me?

 

 

 

Link to comment
  • Level 5*
3 minutes ago, Onesimus said:

I am not a programmer but i made a copy of the log of hazel 

Can you tell us the exact script code you used?

Link to comment
  • Level 5*
26 minutes ago, Onesimus said:

I hope that you can read this and help me?

I'm looking at it and I'll get back to you if I see anything

One of the problems is, you're combining Hazel and Applescript, and you also indicated an Evernote sync problem.

You might try isolating the testing.
This reference might help  https://www.noodlesoft.com/forums/viewtopic.php?f=3&t=1957
It discusses testing the Applescript code outside of Hazel

Link to comment

I am using  OX X El Captitan on my imac

The evernote-version I use  is  Versie 6.7.1 (453575 App Store)

I am very happy that we continue.

Is IFFFT perhaps a possibility

I treid also Wappwolf, but in wappwolf are no business books facilitated. Wit personal books it works. 

 

When I import in evernote I get the book and the tags. The  book stays and the tag comes in with a bullit that it is not yes synchronized.

When the synchronizing has been done the bullit of synchronizing disappear, because is has been synchronized , but.... The tag disappear at te same time.

 

 

 

 

 

 

Link to comment

Answer on two questions I forget.

1. The tags are already in the tags library, They come in with the document , you can see them. Until synchonisation comes than the tags disappear. While they are in the library

2. The tags exist in my account.

 

Link to comment
  • Level 5*
37 minutes ago, Onesimus said:

Is IFFFT perhaps a possibility

I treid also Wappwolf, but in wappwolf are no business books facilitated. Wit personal books it works. 

My solution is to use applescript, triggered when a file is added to the folder

When you right click on a folder, you can see Folder Actions Setup

The applescript has special code that triggers your action, for exampe

on adding folder items to this_folder after receiving new_Files

    

    delay 5

    

    repeat with new_file in new_Files

        Process_File(new_file)      <<<< This is your code

    end repeat

    

end adding folder items to

 

 

Screen Shot 2016-07-18 at 8.04.07 AM.pngScreen Shot 2016-07-18 at 8.02.54 AM.png

 

Link to comment
  • Level 5*
9 minutes ago, Onesimus said:

Answer on two questions I forget.

1. The tags are already in the tags library, They come in with the document , you can see them. Until synchonisation comes than the tags disappear. While they are in the library

2. The tags exist in my account.

So, if you turn off synchronization, your note is ok - with the proper tags?

Link to comment

When I import the document with the tags the tags will stay. Immiditly I turn synchronization off. The tag stay also after som time.

When I chose wifi en I activate synchronization then the tags disappear.

 

 

Link to comment
  • Level 5*
19 minutes ago, Onesimus said:

When I import the document with the tags the tags will stay. Immiditly I turn synchronization off. The tag stay also after som time.

When I chose wifi en I activate synchronization then the tags disappear.

It sounds like your Hazel / Applescript is working correctly

My approach to resolving this would be to reboot my Mac.

If this doesn't resolve the issue, I would delete the app and database 
and then reinstall the app - the database will be rebuilt from the Evernote servers (except for local notebooks)

Link to comment

On my iMac and mac mini I have the same problem.

The solution to remove te software en to reinstall is that the right solution. Two different machines with the same problem is for me a question if reinstall is the right solution.

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...