Simple modification of AppleScript to prepend the word evernote to evernote note title

Hello,

I have a simple AppleScript that works as needed: the result is the tltle of the evernote note currently selected in the note list. I use it to extract the title which I subsequently use to combine with the evenote note link into various documents.

All I would like to do is to prepend the title with the word “Evernote-

For example, if I have an evernote note with the title Covid in Albania, with the script below title = Covid in Albania. I would like title to be Evernote-Covid in Albania

I need to keep the name of the variable as title because it is used elsewhere.

thanks in advance for your time and help

tell application "Evernote"
	if (count of selection) is equal to 1 then
		get title of item 1 of (selection as list)
	end if
end tell

Try this:

tell application "Evernote"
	if (count of selection) is equal to 1 then
		set originalTitle to title of item 1 of (selection as list)
		set newTitle to "Evernote-" & originalTitle
	end if
end tell

This gives you two variables: one with the original title and one with the prepended title. You can use both of them later in your script. If you want to change the title of the note, include this line

set title of item 1 of (selection as list) to newTitle

right after newTitle is defined.

1 Like

great ! thanks very much !