Jump to content
AirplaneGuy

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

Share this post


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

 

 

 

 

 

Share this post


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

Share this post


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

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