Start a new topic
Deferred

Converting Variables to filename safe variations.

You currently have the ability to perform Variable Substring Extraction on variables - eg: extracting partical sections of the resulting strings, converting them to uppercase, lowercase, proper case etc..


Can you PLEASE implement the ability to convert spaces to underscores in variables?


This would be REALLY helpful for when using variables in filenames during ingest, and allow the creation of URL friendly filenames in some of the IPTC fields such as Copyright Info URL and Licensor URL etc..


Thanks.


3 people like this idea

HI, Jason. You can use Find and Replace to change spaces to underscores in variables.  I hope that helps. 

It doesn't help.  


You can't find and replace in JUST the Licensor URL - it affects everything in the Licensor array, so trying to replace spaces with underscores affects:

Licensor:ID
Licensor:Name

Licensor:URL
Licensor:Street Address

Licensor:Extended Address

Licensor:City

Licensor:Region

Licensor:Postal Code

Licensor:Country

Licensor:Telephone


I'm disappointed the answer to this is a straight "Will Not Implement" - it's been requested before by other people who also have guidelines issued by their agencies, so for it not to be considered, when there is no other way to do this except manually and individually on what could be hundreds of photos...  

Find & Replace does not work for this.


3 people like this

Most of the code required to add this feature would already exist in PM6 anyway...


You already have the ability to convert the case of variables, as seen here:


https://docs.camerabits.com/support/solutions/articles/48001077381-variable-substring-extraction


So you can currently make any variable uppercase, lowercase, or proper-case by using


{variable:0:uc}

{variable:0:lc}

{variable:0:pc}


It would literally take 10 minutes or less to duplicate one of the logical expressions that looks for the variable formatted like that but instead of uc, lc or pc is like:


{variable:0:s_}


then to call a function that returns the string with spaces converted to underscores...


Then where {location} would return (for example) "Resorts World Arena", 

{location:0:s_} would instead return "Resorts_World_Arena", which you could use in filename or URL fields on ingest.


Huge benefits for anyone filing to an agency or picturedesk, and VERY little effort to implement.




3 people like this

Sorry - I actually meant to tag this as future consideration. Have you tried using a combination of Grep and excluding extra IPTC fields from search? 


1 person likes this

Yes - but it's still impossible..  in the Find & Replace, you only get the option to perform the find/replace on the whole Licensor array and not the individual fields within that array:

image


So doing a Find & Replace like that will result in this:

image


You'll see the highlighted field is the one I want to make sure has no spaces - That field will be picked up by Google and will apparently tag the image in search results with a 'licensing badge', and the URL will point to the image on my website.. 

The Find & Replace affects ALL the fields howerver, which invalidates most of them.

If variables can be optionally parsed to replace spaces with underscores, then it allows much more flexibility in all steps of the workflow, including ingesting with server compatible filenames, and helping protect our images via the Google Image Licensing feature : https://developers.google.com/search/docs/data-types/image-license-metadata


J.



2 people like this

Oh, I see. I think there may still be some way to do this using a Grep/RegEx search, but I'm not quite familiar enough with the syntax to say, and the people I'd normally ask are currently on vacation. If anyone else has run into this situation and would like to upvote the suggestion, that helps us prioritize. I'll follow up in a couple of weeks if I find a workaround for you. 

I agree that if it is possible to make the change requested by Jason that would be very helpful


1 person likes this

Again I can confirm the same. This would be a very useful feature.

Good suggestion. It would be a handy feature.

I just wanted to keep you all updated on this. We're really focused on getting Photo Mechanic Plus ready for release so I don't have a timeline, but we are discussing solutions. 

I found this one after a long search in the forums and feature requests and just minutes after sending in a very similar feature request myself... I mean: it would indeed be a very welcome feature.

Another +1 for a tick box to remove/replace spaces when renaming files and extracting info from variables. Find and Replace is not optimal.

Login or Signup to post a comment