Jump to content
  • 0

Applescript to set modification date to created date


deiffert

Idea

Sometimes I rename a file or make a small change to a note (fix a typo etc), but I don't want to change to the modification date since that's my default sort method.
 
My idea is to have a quick script that would set the modification date to be equal to the created date. I could run this for a keystroke after I make a small tweak but want the file to stay in it's place.
 
Not looking for criticism of my workflow, just a little help with the script. :)

 
The busted script:

tell application "Evernote"set x to selectionset (modification date of x) to (creationDate of x)end tell

 
The error:

Can’t get creation date of {note id "x-coredata://15696A7B-2038-4C69-B1DB-2ED049C1A7C3/ENNote/p1728" of notebook ".Inbox" of application "Evernote"}.

 
Any ideas would be greatly appreciated!

Link to comment

6 replies to this idea

Recommended Posts

  • Level 5
selection (list of note, r/o) : The note(s) selected in the front-most window. Returns empty list if the front-most window is not a collection or note window, or if there is no front-most window.

Since selection returns a list, if you want to modify a note, you have to specify which item of the list you want. Try something like this:

tell application "Evernote"	set x to selection	set y to item 1 of x	set (modification date of y) to (creation date of y)end tell
Link to comment
  • Level 5*

Sometimes I rename a file or make a small change to a note (fix a typo etc), but I don't want to change to the modification date since that's my default sort method.

 

My idea is to have a quick script that would set the modification date to be equal to the created date. I could run this for a keystroke after I make a small tweak but want the file to stay in it's place.

 

Not looking for criticism of my workflow, just a little help with the script. :)

Any ideas would be greatly appreciated!

 

Not criticizing, just offering information.  Do you know that you can sort your Notes by Creation Date?

Seems like this might avoid the whole issue, and be a simpler workflow.

Link to comment
selection (list of note, r/o) : The note(s) selected in the front-most window. Returns empty list if the front-most window is not a collection or note window, or if there is no front-most window.

Since selection returns a list, if you want to modify a note, you have to specify which item of the list you want. Try something like this:

tell application "Evernote"	set x to selection	set y to item 1 of x	set (modification date of y) to (creation date of y)end tell

 

This works perfectly! Makes perfect sense about specifying which item of the list.

Thanks so much.

Link to comment

Not criticizing, just offering information.  Do you know that you can sort your Notes by Creation Date?

Seems like this might avoid the whole issue, and be a simpler workflow.

 

Umm... yeah I did realize that. :)

 

I'll explain the use case: I have a receipt from 2009. Well I've decided I don't want the date in the note title anymore, but back then I put it in there for some reason. So I remove it from the title and now it's on the top of my note list when sorting by modified date (my preferred sort order). Which is obviously correct, but it's just annoying since it's still a super old note. So this let's me make the change, hit a hot key (keyboard maestro executes the script) and all the meta data for that note stays essentially the same.

Link to comment

 

selection (list of note, r/o) : The note(s) selected in the front-most window. Returns empty list if the front-most window is not a collection or note window, or if there is no front-most window.

Since selection returns a list, if you want to modify a note, you have to specify which item of the list you want. Try something like this:

tell application "Evernote"	set x to selection	set y to item 1 of x	set (modification date of y) to (creation date of y)end tell

 

This works perfectly! Makes perfect sense about specifying which item of the list.

Thanks so much.

 

 

This was very helpful to me. Thanks.

I also tweaked it so that all selected notes will be updated. I had tons of reports for which I wanted to have the modification date reset...

tell application "Evernote"    set s to selection    repeat with i from 1 to (count s)        set y to item i of s        set (modification date of y) to (creation date of y)    end repeatend tell
Link to comment

This was very helpful to me. Thanks.

I also tweaked it so that all selected notes will be updated. I had tons of reports for which I wanted to have the modification date reset...

tell application "Evernote"    set s to selection    repeat with i from 1 to (count s)        set y to item i of s        set (modification date of y) to (creation date of y)    end repeatend tell

 

So awesome!!! Love this script.

Link to comment

Archived

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

×
×
  • Create New...