Evernote - Set EN Mac Modification Date to Creation Date

REQUIRES:
¢ Evernote Mac Versions: 5.5.2, 6.0.1+
¢ Mac OS X: Mavericks or Yosemite


(*
=================================================================
SCRIPT NAME:	Set EN ModificationDate to CreationDate

LAST DATE:	Tue, Feb 17, 2015		VER:  1.1.1

PURPOSE:
	¢ Set the EN Note Modification Date (AKA Updated Date) to its Creation Date
	¢ It operates on ALL Notes that are currently selected by the user

AUTHOR:	JMichael (member of Discussion.Evernote.com forum)
			Please PM me with any bugs/issues/questions

               This script is based in large part on the script provided by HillFool in the EN Forum in this post:
               https://discussion.evernote.com/topic/60390-applescript-to-set-modification-date-to-created-date/?p=338039
						
INSTALLATION:
		¢  Copy to your personal Scripts folder:  /Users/<YourName>/Library/Scripts/
				(create the Scripts folder if it does not exist)

HOW TO USE
		¢  Select one or more Notes in Evernote
		¢  Click on the Apple Scripts menu in the upper right area of your menu
			¢ You can also use FastScripts (http://www.red-sweater.com/fastscripts/) 
				to setup a KB shortcut.
		¢  Click on the name of this script
		¢  The script set Note Modification Date to the Note Creation Date for each Note in the selection
		¢  A completion dialog window will be briefly show when completed
=================================================================
*)

tell application "Evernote"
	set selNotes to selection
	set nNumNotes to (count selNotes)
	
	
	set sAns to display dialog ((nNumNotes as string) & " to be processed") giving up after 3
	
	-- THE BELOW IF TEST IS LIKELY NOT NECESSARY
	--	IF the User clicks "Cancel", it will cancel the script
	
	if sAns is false then
		display alert "User Canceled Script"
		error number -128 -- EXIT this script
	end if
	
	
	repeat with iNote from 1 to nNumNotes
		
		set oNote to item iNote of selNotes
		set (modification date of oNote) to (creation date of oNote)
		
	end repeat
	
	beep
	display dialog (nNumNotes as string) & " Notes Updated Date set to Creation Date" buttons {"OK"} default button 1 giving up after 3
end tell