Jump to content
dgold105

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

Share this post


Link to post

Me to, I'm using v 6.0.13 (451655 Direct).

 

Hope this gets fixed quickly, as it is having a HUGE impact on my workflows

Share this post


Link to post

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.::

Share this post


Link to post

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?

Share this post


Link to post

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 

Share this post


Link to post

Any further word on when this will be fixed - can't believe this core functionality *broke* during an update

 

It's enough to start exploring other options...

Share this post


Link to post

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
  • Like 1

Share this post


Link to post

That works for me thanks! Now to go through and change it on all the folders I use it on...

Share this post


Link to post

 

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...

Share this post


Link to post
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.

Share this post


Link to post

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

Share this post


Link to post
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"

Share this post


Link to post
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?

Share this post


Link to post

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

 

 

Share this post


Link to post
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

Share this post


Link to post

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?

 

 

 

Share this post


Link to post
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?

Share this post


Link to post

tell application "Evernote"

    activate

    set newNote to create note from file theFile notebook {"10301 Gezin Fam JC Rosier"}

    assign tags to newNote("10301", "2016")

end tell

Share this post


Link to post
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

Share this post


Link to post

Iam not a programmer Your answer is to difficult for me.

I am not familiar with those things 

Share this post


Link to post

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.

 

 

 

 

 

 

Share this post


Link to post

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.

 

Share this post


Link to post
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

 

Share this post


Link to post
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?

Share this post


Link to post

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.

 

 

Share this post


Link to post
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)

Share this post


Link to post

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.

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...