Jump to content

Tag Note With Applescript - Variable Not Defined


Recommended Posts

tell application "Evernote"
	
	activate
	
	assign tag "Read" to currentNote
	
	move currentNote to notebook "Articles"
	
end tell

I get the attached error.  Do I need to use Set to set currentNote to something?  I've looked at other applescript and do not see people setting variables. 

Also does anyone know how to set this to a hot key (say F1)? 

Thanks, Chris 

Screen Shot 2016-09-24 at 8.19.14 AM.png

Link to comment
  • Level 5*
1 hour ago, AirplaneGuy said:

I get the attached error.  Do I need to use Set to set currentNote to something?  I've looked at other applescript and do not see people setting variables. 

 

You're using a variable called currentNote, you need to define it

You could add a statement       set currentNotes to  selection
selection is a defined as the notes currently selected 

Note, this is a list; there could be more than one
You need to create a repeat loop, for example

     repeat with currentNote in currentNotes
     ....
     end-repeat

>>Also does anyone know how to set this to a hot key (say F1)? 

I use Fastscripts to assign shortcuts to my scripts
There's also something about setting up a service in the Mac OS and assigning a shortcut - it's convoluted and I don't use it

 

 

 

 

 

Link to comment
tell application "Evernote"
	
	activate
	
	set currentNote to selection
	
	set currentNotes to selection
	
	repeat with currentNote in currentNotes
		
		assign tag "Read" to currentNote
		
		move currentNote to notebook "Articles"
		
	end repeat
	
end tell

Thanks for the help! Here is what I came up with...Seems to work pretty good. 

Link to comment
  • Level 5*
8 minutes ago, AirplaneGuy said:

Thanks for the help! Here is what I came up with...Seems to work pretty good. 

Good stuff

You could delete the    set currentNote to selection

It isn't doing anything useful

Link to comment

Archived

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

×
×
  • Create New...