Copier le lien dans le Presse-papiers
Copié
Example:
Filename and path: Macintosh HD:Users:rob.freeman:Desktop:Filename
--------
Hi, I would like to apply a bold style to the last word of the string above. 'Filename' with a grep style. I have found a grep style here:
^[^:]+:
But this adds the bold at the beginning. How do I get this to be like this:
Filename and path: Macintosh HD:Users:rob.freeman:Desktop:Filename
lister
Copier le lien dans le Presse-papiers
Copié
try this grep
:\KFilename$
Copier le lien dans le Presse-papiers
Copié
Hi!
(\H+):\K(?1)\b
(^/)
Copier le lien dans le Presse-papiers
Copié
And another a bit different approach that seems working too:
:\K[^:]+?$
Copier le lien dans le Presse-papiers
Copié
winterm,
Yeap if you target simple paras!
Nope if this sentence is included into a para as:
"xxxx xxxx (filename and path: Macintosh HD:Users:rob.freeman:Desktop:Filename.psd) xxxx xxxx."
(^/)
Copier le lien dans le Presse-papiers
Copié
Sorry, it needs to target the last word of this style , basically after the last colon.
Copier le lien dans le Presse-papiers
Copié
Whatever, Obi-wan. Seems like OP has a somewhat different problem since neither code works for him.
Copier le lien dans le Presse-papiers
Copié
(^/)
Copier le lien dans le Presse-papiers
Copié
The only problem is the text is dynamic. So it shouldn't look for a particular word.
Copier le lien dans le Presse-papiers
Copié
well, I didn't understand good your question
I thought the word is always the filename
is always better to make a precise question for a precise answer
Copier le lien dans le Presse-papiers
Copié
Hi Vladan, sorry to confuse you.
Hi Obi, this doesn't seem to work:
(\H+):\K(?1)\b
and the code here
:\K[^:]+?$
adds the bold style to everything after the first ':'
Filename and path: Macintosh HD:Users:rob.freeman:Desktop:Filename
thanks so far
Copier le lien dans le Presse-papiers
Copié
:\K\w+$
Copier le lien dans le Presse-papiers
Copié
Thanks Vladan for swift response, but this does seem to work:
Copier le lien dans le Presse-papiers
Copié
Copier le lien dans le Presse-papiers
Copié
Vladan,
Try: aaabbb_ccc.txt
(^/)
Copier le lien dans le Presse-papiers
Copié
Maybe our friend has copied the \r at the end of our code!
It won't be the first time!
(^/)
Copier le lien dans le Presse-papiers
Copié
in your character style did you choose bold?
Obi: well, we expect a more detailed question of lister110 in that sense
Copier le lien dans le Presse-papiers
Copié
??
… Or:
(^/)
Copier le lien dans le Presse-papiers
Copié
mmm, can't seem to get this to work in a paragraph style:
Copier le lien dans le Presse-papiers
Copié
I think the problem is I am using a variable as the path and file name.
Vladan you grep works but not on the dynamic part of the text. Can grep work on variable text?
thanks everyone for your input.. really appreciate it.
Copier le lien dans le Presse-papiers
Copié
A variable! LOL!
(^/)
Copier le lien dans le Presse-papiers
Copié
Thanks again. Maybe its harder to target a variable? Sorry for all the confusion..
Copier le lien dans le Presse-papiers
Copié
In this video, I've manipulated the variables by script!
InDesign: TOC, Caption & Variable! … - YouTube
In your case, it's easy [and I'll use my grep code] to manipulate them to have the result you want without loosing the dynamic link!
The bad news: I don't write script for free!
(^/)
Copier le lien dans le Presse-papiers
Copié
No problem. Appreciate the help.
Trouvez plus d’idées, d’événements et de ressources dans la nouvelle communauté Adobe
Explorer maintenant