help needed with a macro

Post Reply
mdebokx
Posts: 7
Joined: 25 Nov 22 18:10

help needed with a macro

Post by mdebokx »

I have a bunch of photo's where I like to update the Headline and Document Title. In this use case I can re-use the filename with macro %FileName to fill both elements. Also in this use case, some filenames are numbered/sequences due to same object name; like 'anemone shrimp (03)' or 'anemone shrimp (04)' etc.
is there a way to substring the %FileName so that I can remove the ' (03)' for example or remove last 5 characters?

I tried several options like
%FileName{trunc={width={%FileName}-5}}

but I miss the clue somewhere

who can give me a macro that will remove the sequence at the end?
thanks
Ralf
Posts: 134
Joined: 19 Jan 19 13:37

Re: help needed with a macro

Post by Ralf »

I'm not entirely sure, I think you could do this with the following (can't test right now)
Example 1:
%FileName{word=1,,(}

where the character ( would be the separator and then take the first word from it

Example 2:
%FileName{left=5}
or {right=20}
%FileName{mid=4,10}
Ralf
---------------------------------------------------------------------------------
Hobby photographer with many pictures (> 100000) of the family over generations.
(Excuse my english)
mdebokx
Posts: 7
Joined: 25 Nov 22 18:10

Re: help needed with a macro

Post by mdebokx »

thanks for reaching out.
this one works fine for me: %FileName{word=1,, (}
I added an extra space and then it works :D I'm happy
Post Reply