Author Topic: Simplifying caption editing  (Read 6536 times)

Offline Claude Diderich

  • Newcomer
  • *
  • Posts: 33
  • Claude Diderich
    • View Profile
    • Claude Diderich Sports Pictures
Simplifying caption editing
« on: October 06, 2016, 11:36:29 PM »
It often happens that I copy / patse athletes names from a PDF roster directly into the IPTC caption. To simplify this task, the following two key shortcut features would be great:
  • Shortcut to capitalize the next word - Team rosters often have names in all caps, but captions may require capitalized names. Example: MARCHANT -> Marchant, by pressing a special shortcut, e.g. ALT+C.
  • Shortcut to switch the following two world - Team rosters often have a 'lastname firstname' convention, but captions may require 'firstname lastname' (or vide versa). Example: Duck Donald -> Donald Duck, by pressing a special shortcut, e.g., ALT+T
Claude Diderich, sports photographer, member of AIPS and sportpress.ch
Mülibachstrasse 49, CH-8805 Richterswil, Switzerland, phone: +41 (44) 450 81 66, fax: +41 (44) 450 81 19, mobile: +41 (79) 450 81 66, e-mail: cdiderich@cdsp.photo, internet: http://www.cdsp.photo/

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Simplifying caption editing
« Reply #1 on: October 07, 2016, 03:40:55 AM »
Are you on a Mac? Then you can create these actions yourself quite easily. Open automater and have it create a new service. Have the service act on text (if you like you can restrict the service to act on text in PhotoMechanic only) and have it run a perl script. In that script you specify what to do with the provided input (=selected text). E.g. for swapping two words, you could use
Code: [Select]
undef $/; $_ = <>; s/(\w+)(\s+)(\w+)/$3$2$1/s; print; and to capitalise a word, you could use
Code: [Select]
undef $/; $_ = <>; s/(\w+)/ucfirst(lc($1))/es; print; If you have perl 5.16 or newer installed, you can improve the latter a bit so it works correctly on complex Unicode and use this as script
Code: [Select]
use v5.16; undef $/; $_ = <>; s/(\w+)/ucfirst(fc($1))/se; print;
Once you've created the service you can find it in the context menu (right click the text) either directly or (if you have many text services) or in a Services submenu. The fun doesn't stop there though; you can also assign a shortcut key to the service! To do that, go to System Setup, Keyboard, Shortcuts, Services and scroll down in the list to find your service and give it a keyboard shortcut.

I have attached a screen shot of the Automator with the uppercase action.

One caveat: there is a slight delay when running the service, this is because it has to start an external process to run the actual service in.

Enjoy,
Hayo

P.S. this was actually the first time I tried to create a service like this, but as you can see it isn't too difficult.
« Last Edit: October 07, 2016, 03:52:27 AM by Hayo Baan »
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Simplifying caption editing
« Reply #2 on: October 07, 2016, 05:56:18 AM »
Oops, scrap the second shell script that is shown in the screenshot; that shouldn't be there…
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Claude Diderich

  • Newcomer
  • *
  • Posts: 33
  • Claude Diderich
    • View Profile
    • Claude Diderich Sports Pictures
Re: Simplifying caption editing
« Reply #3 on: October 07, 2016, 11:32:38 AM »
Are you on a Mac? ...

Sound great, but unfortunately I am on Windows 10.
Claude Diderich, sports photographer, member of AIPS and sportpress.ch
Mülibachstrasse 49, CH-8805 Richterswil, Switzerland, phone: +41 (44) 450 81 66, fax: +41 (44) 450 81 19, mobile: +41 (79) 450 81 66, e-mail: cdiderich@cdsp.photo, internet: http://www.cdsp.photo/

Offline fabianlujan

  • Full Member
  • ***
  • Posts: 107
  • sports photographer
    • View Profile
Re: Simplifying caption editing
« Reply #4 on: October 11, 2016, 11:08:44 AM »
Hello Claude,

Are you able to make these preparations beforehand?

I guess copy/paste and modify on the go makes you slow your workflow. Does it?

My job is motorsports and I require tagging around 80-90 cars per weekend.

Lots of IPTC information.

The participants list are available the week prior the race, so I make a txt file and use it to autocomplete.

Does it work for you?

Offline Claude Diderich

  • Newcomer
  • *
  • Posts: 33
  • Claude Diderich
    • View Profile
    • Claude Diderich Sports Pictures
Re: Simplifying caption editing
« Reply #5 on: October 13, 2016, 02:01:12 AM »
I agree. If I have the information beforehand, I can (and do) prepare code replacement files. I am doing all the editing of the code replacement text file using the Emacs editor (which has huge editing features allowing to do just that and even automate most through macro recordings).

But very often, the information is not available beforehand. It only gets published when the results are made available.
Sometimes the information is available beforehand, but the effort to pre-process all names (50 participants) versus only post-process the winning athletes (3 names, the podium ones), is not worth the advantage.

Hello Claude,

Are you able to make these preparations beforehand?

I guess copy/paste and modify on the go makes you slow your workflow. Does it?

My job is motorsports and I require tagging around 80-90 cars per weekend.

Lots of IPTC information.

The participants list are available the week prior the race, so I make a txt file and use it to autocomplete.

Does it work for you?
Claude Diderich, sports photographer, member of AIPS and sportpress.ch
Mülibachstrasse 49, CH-8805 Richterswil, Switzerland, phone: +41 (44) 450 81 66, fax: +41 (44) 450 81 19, mobile: +41 (79) 450 81 66, e-mail: cdiderich@cdsp.photo, internet: http://www.cdsp.photo/

Offline judophotos

  • Full Member
  • ***
  • Posts: 238
    • View Profile
    • Judophotos
Re: Simplifying caption editing
« Reply #6 on: October 13, 2016, 01:39:54 PM »
I am very interested in simplifying captioning, especially the names of competitors.

I'm at an event on Saturday where there are 253 competitors and are all named on an international website. A copy of a few of them in the u81kg weight category are on the attached clip.

For a caption I need to show the name in the normal format of Given name/Family name such as David Finch. But to select that normally I have to type in the family name first.

As you can see from the listed names they are reversed with the family name in capitals such as FINCH David.

Over the years I have built up a very large collection of names that are listed in the 'People' section of PM's caption fields.

However, I would like to use a list that is relevant to each competition because, in the early rounds a lot of unseeded names are needed and manually typing them in is very slow and requires finding them on the results sheet if they are not on the PM People list.

Does anybody have an automated system for isolating the names on the competitor list shown and converting them to "Family name, Given name, Family name" so that I can type the Family name letters first to get the name on the caption and then delete the initial Family name?

This is a typical caption for the medallists. For the countries I use standard code replacement such as \UAE\ prints out as "of the United Arab Emirates" etc. That works well. 

"RIO DE JANEIRO, BRAZIL, AUGUST 09:  Under 81kg medallists L-R:  Bronzes; Takanori Nagase of Japan and Sergiu Toma of the United Arab Emirates, Gold; Khasan Khalmurzaev of Russia and Silver; Travis Stevens of the United States, during the medal ceremony on day 4 of the 2016 Rio Olympic Judo, Tuesday, August 09 at the Carioca Arenas, Barra, Rio de Janeiro, Brazil. (Photo © by David Finch. All rights reserved. Including image always credited to David Finch)