Jump to content
  • 3

Rename Attachment to Title


MrPhil

Idea

When I using the Rename Attachment option, it pre-populates the rename text box with the attachments current name which make is a bit painful when I am renaming the attachment to match the Note's title

 

Is there a way to bulk rename attachments to the the Note's title that I am missing?

 

I know you shouldn't really need to worry about the attachment's name as everything is indexed, but my must-be-tidy gene plays havoc when the attachment titles have no relation to the Note title. 

 

If not, could I request that either there is (a) Rename Attachments to Note Title option that will apply to all selected notes or (B) a sticky option on the Rename dialogue that when ticked pre-populates the text box with the Note's title and not the current attachment's name?

 

Appreciate your views

 

Thanks

 

Phil

Link to comment

28 replies to this idea

Recommended Posts

I completely agree with the need for an automated process for renaming attachments to the note title. Also, there seems to be a bug - see my support ticket request below. Has anyone else experience this on the MacOS platform?

"I often scan documents and attach them to notes. I always rename the attachment as the date/time default is not helpful. However, every time I rename the document when I first create the note (I scan and save through a Fujitsu ScanSnap s1300i), the new name doesn't save. When I return to that note after viewing another note, the document's name has reverted to the date/time default. I am usually able to rename it at that point, but even then sometimes it reverts for a second time.

The attached screenshot shows a note where I had tried to rename the document twice (to the note title), but once again it reverted to the default.
I noticed that this occasionally happened in previous Evernote versions as well, but it usually works fine. Is this a bug? Can you please fix it? This is a feature I heavily rely on!"

Bug with renamed attachment.png

Link to comment

Count me in on requesting a feature that renames an attachment using the note title.  I'd love just a simple button to press and "bam!" the attachment is renamed to the note title keeping the existing file extension (e.g. pdf).  Multiple attachments can be serialized to avoid duplicate attachment names.  Currently, I scan a bill in, then I title the note, select the note title, right click, then copy the title name, then right click, rename attachment, then paste, then hit "rename."  When you're dealing with a lot of different scans, its a cumbersome process.  

Scanning to some folder, renaming the file, then creating the note isn't much better.  In fact, it seems more resource intensive for the user and hard drive.  It also introduces a clean-up task to delete everything in the folder.    

Please create this feature in your next version.  Make it a button in each note - next to the alarm clock, annotate and other feature buttons.

Kevin

Link to comment
  • Level 5*
4 hours ago, TomCog said:

Another severe limitation imposed by the way Evernote handles naming attachments is that even if you change the name - of a PDF, for example - the version that is locally stored on your computer does not get renamed.

Why keep the copy on your computer?  Not sure on the Mac, but can't you enable deleting the input file after it has been added to EN?  Unless you have a special reason to have the PDF in two places.

Link to comment

Another severe limitation imposed by the way Evernote handles naming attachments is that even if you change the name - of a PDF, for example - the version that is locally stored on your computer does not get renamed. I scan directly to my Evernote account through my printer/scanner all the time, so all of my attachments have nonsense names. Yes, it's a hassle to have to go through and manually rename them, as Evernote doesn't provide an intelligent way to do this, but the local copies retain the original nonsense name. I regularly back up my local Evernote files and it's very difficult to make sense of them due to the way Evernote names everything. Cynically, I feel like they do this intentionally to make them useless without accessing them via the Evernote app. They're my files...Evernote shouldn't be making it difficult for me to manage them to compel me to rely on their product.

Link to comment

I too have the need for this. We store invoices in Evernote and every quarter we need to export them as PDF to our accountant.  We keep the note titles correct and when we export, we end up with the filenames of the PDF's and not our note titles. A bulk rename would be great or write access from applescript.

Is there any improvement in this area?

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

I find it hard to believe that so few Evernote users have this requirement.

I try to make a practice of renaming my attachments.

I don't have that many, and the existing multi-step process hasn't bothered me

Link to comment

I have a similar tendency as @csihilling. Most things are already properly named. Anything that is not properly named just goes into Evernote anyhow with the ugly name since the note title or document contents are more than sufficient for search. I'll only rename the file if it is getting moved to another storage location where filename matters, or if I'm sending it elsewhere. 

I think it would be a great feature to be able to rename an attachment to the note title or any other arbitrary selection of text (though how to handle it if there are multiple attachments?), but I can only suspect that this would be a lower priority feature if it even made it onto Evernote's "to-do" list. 

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

I find it hard to believe that so few Evernote users have this requirement.

Just one user here, but I only rename scanned or emailed attachments when I need to share with someone else.  Not having them named doesn't effect search or anything else within EN in my use case.  FWIW. 

Link to comment

 

Quote

(a) Rename Attachments to Note Title option that will apply to all selected notes or (B) a sticky option on the Rename dialogue that when ticked pre-populates the text box with the Note's title and not the current attachment's name?

I would also like something like @MrPhil suggested. The workflow suggested by @ScottLougheed is too many steps when renaming many attachments.

Link to comment

Any solution for this yet? I spend hours every month renaming PDF attachments to the note title (downloaded into Evernote from different sources - scanner, gmail, etc.).

I don't know how to debug scripts so unless someone can provide a working one, I have to wait for Evernote to program a solution. 

Link to comment
  • Level 5*

Evernote ended support of attachment file rename via Applescript many months ago — JMichael's method used to work.  Ever since, at least for me, it's lead to countless frustration and shaking of fists !

 

I just wanted to confirm that Evernote has changed the AppleScript support for renaming attachments.

The filename property of the attachment object is now read/only (r/o).

I'm not sure when it changed.

 

From the AppleScript dictionary:

 

attachmentn : A note attachment. Image, Audio, PDF, etc.

elements

contained by notes.

properties

filename (text or missing value, r/o) : The attachment's original filename, if available.

mime (text, r/o) : The attachment's mime type.

size (integer, r/o) : The attachment's size in bytes.

source URL (text or missing value, r/o) : The attachment's source URL.

latitude (real or missing value)

longitude (real or missing value)

altitude (real or missing value)

hash (text, r/o) : The attachment's hash (used to identify the attachment in the note's ENML).

recognition data (text or missing value, r/o) : Recognition data for this resource, if any. Note that a resource will not have recognition data until it is provided by the service. This XML data conforms to the following DTD: http://xml.evernote.com/pub/recoIndex.dtd

 

This seems like a lot of work to go though just to rename the attachment, but if you really want to, you might try this in AppleScript 

  1. Save the attachment to file using the write command
  2. Rename the file using the Finder commands
  3. Add the attachment with its new name back to the Note using the append note command
  4. Delete the original attachment

Note:  I have NOT tested any of this -- it is just an outline of the code you would need to write.

 

This will result in:

  1. the attachment changing position within the Note, probably going to the bottom of the Note.
  2. If the Note involved is in a sync'd Notebook, this will consume some of your monthly upload allowance.
  3. There may be other side effects I'm unaware of

Frankly, I don't recommend doing this.  IMO, the cost/impact of renaming the attachment far outweighs the benefit of doing so.  But that is for each person to judge.

 

Link to comment

Evernote ended support of attachment file rename via Applescript many months ago — JMichael's method used to work.  Ever since, at least for me, it's lead to countless frustration and shaking of fists !

 

Although It's less reliable than the old way, and it's occasionally buggy, I use the following script to:

 

1) export the note to an external file with the same name as the note's title

2) clean up the note's HTML content by removing the attachment reference tag

3) reattach the external file to the end of the note

 

It's written to only work with notes having a single PDF or JPG attachment.  In theory it handles multiple notes, but I tend to use it on just one note at a time, which minimizes potential complications in the event of a file system hiccup.  Of course, you should first test it thoroughly on notes you don't mind accidentally damaging.

 

set theTargetFolder to (path to desktop folder as string) & "Evernote Attachments"tell application "Evernote"	activate	set theNotes to selection	repeat with theNote in theNotes		set theNewAttachmentName to title of theNote as string		set theContent to HTML content of theNote		if (count of attachments of theNote) = 1 and ((theContent contains "type=\"evernote/x-pdf\"") or (theContent contains "id=\"en-media:image/jpeg")) then			set theAttachments to attachments of theNote			repeat with theAttachment in theAttachments				if filename of theAttachment is not missing value then					tell application "Finder"						if folder theTargetFolder exists then delete theTargetFolder						make new folder at (path to desktop folder as string) with properties {name:"Evernote Attachments"}					end tell					set theType to text -4 thru -1 of ((filename of theAttachment) as string)					if text -4 thru -1 of theNewAttachmentName is not theType then						set theNewAttachmentName to theNewAttachmentName & theType					end if					write theAttachment to (theTargetFolder & ":" & theNewAttachmentName)					delay 0.5				end if			end repeat		end if		if theContent contains "type=\"evernote/x-pdf\"" then			set theContent to my RemoveTagContaining(theContent, "type=\"evernote/x-pdf\"")		else if theContent contains "id=\"en-media:image/jpeg" then			set theContent to my RemoveTagContaining(theContent, "id=\"en-media:image/jpeg")		end if		set (HTML content of theNote) to theContent		tell theNote to append attachment file (theTargetFolder & ":" & theNewAttachmentName)		delay 0.5	end repeatend telltell application "Finder"	if folder theTargetFolder exists then delete theTargetFolderend tellon RemoveTagContaining(theHTML, theSearchValue)	set theDefaultDelimiters to AppleScript's text item delimiters	try		set AppleScript's text item delimiters to ">"		set theHTMLTags to text items of theHTML		set theNewHTMLTags to {}		repeat with i from 1 to count of items in theHTMLTags			if item i in theHTMLTags does not contain theSearchValue then				set the end of theNewHTMLTags to item i in theHTMLTags			else				set the end of theNewHTMLTags to "<!--Placeholder--"			end if		end repeat		set theNewHTML to (theNewHTMLTags as string)		set AppleScript's text item delimiters to theDefaultDelimiters		return theNewHTML	on error		set AppleScript's text item delimiters to theDefaultDelimiters		return theHTML	end tryend RemoveTagContaining
Link to comment
  • Level 5*

@Dirk:

 

I don't know why that would not work.

 

Sorry, but AppleScript is hard enough to debug when working directly with the AppleScript editor on my machine.

I don't think I'd be very productive trying to debug via this forum.

 

You might try some simple stuff, like hard coding a filename you know will work, and test that.

 

Other than that, all I can offer are some learning resources:

 

 
AppleScript Scripting Additions
 
Books
Link to comment

@Dirk:

 

I don't understand Dutch.  You will need to translate the error message.

Did you add the code to get the attachments extension?

 

Of course... It says:

error "Evernote had an error: filename of attachment can not be set at \"20150409.pdf\"." number -10006 from filename of attachment

 

Where 20150409 in this case is the filename. But also "20150409 Hersenspinsels" as a filename did not work.

 

Yes I removed the comment signs and now the command SET is recognized by the applescript editor. 

 

Do you have an idea what might cause this?

Does the script work on your computer?

 

Thanks, Dirk

Link to comment

Dear Explorer, 

 

Thanks for your reply!

 

It seems to work but when I execute the script I receive the following error (in Dutch):

 

error "Evernote kreeg een fout: filename of attachment kan niet worden ingesteld op \"20150409.pdf\"." number -10006 from filename of attachment

 

So at the end there is a bug. The filename that it wants to change into is:

"20150409 Hersenspinsels". But also a shorter name (of 6 characters) does not work.

 

Do you know what might cause the error in the script?

 

Thanks in advance!

Dirk

Link to comment
  • Level 5*

@Dirk:

 

Here is a quick & dirty script just to illustrate the approach.  

As it is it will NOT make any changes, just output the new Attachment name.

I have given this very limited testing using one Note.

 

For more examples and info, do a google on "evernote applescript", and take a look at Veritrope.com.

 

 

To use:

  1. Open EN Mac and select one Note in the Note list
  2. Copy this Note to use for Testing, just in case.
  3. Click on the TEST Note.
  4. Open the AppleScript Editor, and paste in the below code
  5. Click the "Compile" button
  6. Click the "Run" button.
  7. Click on the "Result" button at the bottom to see the new name.
  8. Write the code to get the actual file ext.
tell application "Evernote"		set theNote to item 1 of (get selection)	set theNoteTitle to title of theNote			repeat with theAttachment in (attachments of theNote)				set theAttachment to item 1 of (attachments of theNote)				set theExt to ".pdf" -- you need to add code to get the actual file extension				set theMime to mime of theAttachment				set theNewName to theNoteTitle & theExt				-- I have commented out the last line which will actually change the name of the Attachment		-- You can run this script in the AppleScript editor and it will show the new name in the Results block at the bottom.				--set filename of theAttachment to theNewName			end repeat	end tell
Link to comment

I fully agree with this request. Please include an automated feature that renames the attachment to the title of the specific journal entry.

Manual renaming is so user unfriendly. Especially when using a scanner like Scansnap with lots of scanned notes.

 

Please include this requested feature. It is not that difficult to program and means much for user friendliness!

Link to comment

But doesn't help my problem.  For me, I use SnapScan to scan directly to an Evernote Notebook (Local), amend as required and then file into a syncronised Notebook.  Now I agree, at this point I could also rename the scanned attachment, but given I now have thousands of notes and attachments, this doesn't help :-)

 

A bulk rename would be magical

 

Phil

Link to comment
  • Level 5*

I think in the case of multiple attachments then a sequence number would be attached and be numbered in the order the attachments were added to the note. Wont be right for everyone but I expect it will be right for over 80% of people.

 

Having just spent a week scanning paperwork directly into Evernote, I have found one or two things that would make using the product easier. The naming of attachments to fit better into the workflow (of scanner directly into EN) is one of them. A nice option would be to automatically rename attachments when the note title changes - with a sub-option that offers  [ ] Only for notes with one attachment or [ ] Multiple Attachments and add sequence number 

 

Or something - just need this to work better :-)

 

Phil

 

Many of us scan to a non-import folder first, rename the file, then import.  This is quick and easy.

Link to comment

I think in the case of multiple attachments then a sequence number would be attached and be numbered in the order the attachments were added to the note. Wont be right for everyone but I expect it will be right for over 80% of people.

 

Having just spent a week scanning paperwork directly into Evernote, I have found one or two things that would make using the product easier. The naming of attachments to fit better into the workflow (of scanner directly into EN) is one of them. A nice option would be to automatically rename attachments when the note title changes - with a sub-option that offers  [ ] Only for notes with one attachment or [ ] Multiple Attachments and add sequence number 

 

Or something - just need this to work better :-)

 

Phil

Link to comment

There isn't currently any way to bulk rename attachments. The fastest workflow for an existing attachment might be to copy the note title, THEN select rename attachment, and paste over the pre-populated name. 

 

Another option I might recommend is for new notes, change the name of the file to whatever you want the note title to be. This way, you can drag and drop the attachment into a notebook or onto the Evernote icon and the note that is created will take on the title of the file you just attached. Of course, this wouldn't necessarily work if you are attaching a file to an existing note. 

 

I think the general idea behind the request is sound. However there are some technical challenges I can predict, namely, how to handle notes with multiple attachments. Do all the attachments in that note get identical names? This could be terribly confusing for a user (if I had three images in a note all with the same name!) and for the computer (opportunity for files with identical names to overwrite eachother). You could add a numerical suffix, I suppose, but depending on how attachments are stored in the database these suffixes might not correspond to the order the attachments appear in the note (I don't know anything about this though but it is a potential issue). 

Definitely consider your request made, as EN staff do frequent these boards! But, alas, it is ultimately up to them if/when this gets implemented! 

Link to comment

Archived

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

×
×
  • Create New...