ASCII
I am using the tag "UserComment" for Last Name of a picture file. When I rename the file, I get "ASCII" at the beginning of the name. How do I eliminate this from happening?
Tom
Tom
Reply to #1:
Welcome, Tom!
I don't see this with any of my files (link to an image if you can). What version of Aren are you using?
In general you can strip that ASCII with a tag modifier like :substr:.
For example:
<ExifTool:Comment:substr:6:222>
Regards,
Randy
Welcome, Tom!
I don't see this with any of my files (link to an image if you can). What version of Aren are you using?
In general you can strip that ASCII with a tag modifier like :substr:.
For example:
<ExifTool:Comment:substr:6:222>
Regards,
Randy
Reply to #2:
This is what I'm getting ASCIIShaw Delainey 0355
Version 4.20
This is what I'm getting ASCIIShaw Delainey 0355
Version 4.20
Reply to #3:
Did you try adding the ":substr:6:222" (without the quotes)?
That works for me on other tags**.
** I don't have any files with a naturally occurring "UserComment". ;)
Did you try adding the ":substr:6:222" (without the quotes)?
That works for me on other tags**.
** I don't have any files with a naturally occurring "UserComment". ;)
Reply to #4:
Hi guys,
I'm curious if that field *always* includes the ASCII string or just occasionally. If occasionally you might want to use an add-on Replace or Remove Pattern method to strip out ASCII only when it occurs.
-OR- (and Randy, I am shocked, SHOCKED I tell you, that you did not suggest this! :)
A small javascript that pulls the field and replaces only the word ASCII. I don't have any UserComment fields, so I tested it with DeviceType (all "Cell Phone" on my system), replacing "Cell" with "Mobile". Anyway, it can be as simple as:
// ---------------------------------------------------------------------------------------------------
return item.newBasename + app.exifToolValue('UserComment').replace( /ASCII/, "" ) ;
// ---------------------------------------------------------------------------------------------------
or, if you have other recurring fields that include extra information, it could be generalized like:
// ---------------------------------------------------------------------------------------------------
let exTagStr = "UserComment" ; // exifTool tag value, e.g. "UserComment", "Comment", whatever.
let toReplStr = "ASCII" ; // Value to replace, e.g. "ASCII"
let replWithStr = "" ; // What to replace with; if removing, leave blank ("")
let regex = new RegExp( toReplStr, "ig" ) ;
let comment = app.exifToolValue(exTagStr).replace( regex, replWithStr ) ;
return item.newBasename + comment ;
// ---------------------------------------------------------------------------------------------------
Follow the directions in the comments on the first three lines and you have a new script, bingo-bango. I can't test it like it stands, but I did test it with my previous field/string values.
Best
Hi guys,
I'm curious if that field *always* includes the ASCII string or just occasionally. If occasionally you might want to use an add-on Replace or Remove Pattern method to strip out ASCII only when it occurs.
-OR- (and Randy, I am shocked, SHOCKED I tell you, that you did not suggest this! :)
A small javascript that pulls the field and replaces only the word ASCII. I don't have any UserComment fields, so I tested it with DeviceType (all "Cell Phone" on my system), replacing "Cell" with "Mobile". Anyway, it can be as simple as:
// ---------------------------------------------------------------------------------------------------
return item.newBasename + app.exifToolValue('UserComment').replace( /ASCII/, "" ) ;
// ---------------------------------------------------------------------------------------------------
or, if you have other recurring fields that include extra information, it could be generalized like:
// ---------------------------------------------------------------------------------------------------
let exTagStr = "UserComment" ; // exifTool tag value, e.g. "UserComment", "Comment", whatever.
let toReplStr = "ASCII" ; // Value to replace, e.g. "ASCII"
let replWithStr = "" ; // What to replace with; if removing, leave blank ("")
let regex = new RegExp( toReplStr, "ig" ) ;
let comment = app.exifToolValue(exTagStr).replace( regex, replWithStr ) ;
return item.newBasename + comment ;
// ---------------------------------------------------------------------------------------------------
Follow the directions in the comments on the first three lines and you have a new script, bingo-bango. I can't test it like it stands, but I did test it with my previous field/string values.
Best
Reply to #5:
Jeez a fella gets lazy and non-coder-friendly ONE time... ;P
Jeez a fella gets lazy and non-coder-friendly ONE time... ;P