The quickest way to write-back all pending metadata

Started by ColinIM, December 05, 2014, 05:42:04 PM

Previous topic - Next topic

ColinIM

I feel sure this query has been raised at least once in these threads, possibly during the beta phase, but I can't locate it.

What is the shortest, quickest way to achieve Metadata Write-back for all pending files please?

(I've turned OFF "Preferences | Background processing | Write back changes ... immediately" of course.)

I've searched the Help pages in all of the contexts which I think might relate this question - but I can't see any quicker way to achieve this except to do all of the following:

       
  • [Menu] | Commands | Metadata Write-back | For all pending files ...
  • followed by a click on the "Yes" button on the pop-up dialogue which asks
  • "Do you want to write back to these files now?"
Can I not create a Favorite to do this with one or two clicks?
Or can I not define a new Keyboard shortcut to do it?

(I can see nothing along these lines in the Help | Favorites or Help | Metadata Write-back pages.)

Or do I need to write a script?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Here's the reason I'm searching for this (maybe non-existant) short-cut

I'm working on a modest sized database of newly scanned images, and I'm doing a lot of the following:

1. Selecting a sub-set of files (maybe six to ten in each sub-set)
2. Adding a number of keywords (many new ones, and many already in the growing thesaurus)
1. Selecting a different sub-set of files
2. Adding some more keywords
... repeating 1. and 2. a few more times ... then
3. Writing back all metadata

   and again ...

1. Selecting a sub-set of files
2. Adding a number of keywords
1. Selecting a different sub-set of files
2. Adding some more keywords
... repeating 1. and 2. a few more times ... then
3. Writing back all metadata
... etc. etc. ...

It's blissfully fast to do steps 1. and 2. many times in succession, but then - because I've changed the selections when attending to the different sub-sets of files - I'm not able simply to click on one yellow pencil on just one of the set of "selected" thumbnails to write back the metadata for all of the sub-sets of images on which I've operated since the previous write-back.

(One obvious solution would be to do a write-back on each sub-set of files before changing their selection, but I trust you'll agree that - even though a metadata write-back on multiple files is satisfying fast on my system - each metadata write-back is an unavoidable 'break' in the 'contemplative flow' of devising new and appropriate keywords - so any way to speed it up - ideally with one keystroke or one mouse-click - would be hugely welcome.)

(I'm sorry for that hasty and convoluted description.  Blame my pent-up frustration at not being able to locate the answer to this query, anywhere, for myself!!!)

I hope I've missed an (almost) obvious trick somewhere(?) - but if not then I'll raise a Feature Request.

Thanks!
Colin P.

pajaro

I don't know if this is what you are looking for but I use Collections-Pending Metadata Write-back. Very convenient for my workflow.

Pavel.

ColinIM

Hi Pavel,

Yes - Collections - thanks.  I should re-consider the Collections tab as being a 'near miss' solution for the one I hope(d) to find.

I'd seen this Collections 'option' during my searches but I'd metaphorically walked past it because it was (it is) not quite the "one or two clicks" solution I felt sure would be tucked away somewhere inside IMatch - while hoping at the same time to avoid switching panels, and hence breaking that 'flow' that I was absorbed in!

I'd also noted that in order to use the Collections | Pending Metadata Write-back method I will need to apply a CTRL+A / Select All on the contents of that tab just before I click on one of the yellow pencils ... which admittedly is a very minor extra step.  But yes, in the absence of any other solution - and at the 'cost' of switching my attention away from the active, Media & Folders tab - this is a shorter route to my goal than navigating the Commands Menu.

I'll cross my fingers that a one or two click, non-panel-switching method might still bubble up from somewhere (?) and I'll try using this Collections tab idea in the meantime.  Thank you again.

I hope I don't come across as being ungrateful for your hint Pavel  :) I'm just musing aloud on why Mario hasn't made this global variation on metadata write-back more accessible than it is (or than it seems to be). 

Cheers,
Colin P.

Ger

Colin,

Why don't you write-back metadata only when you're done with processing x sub-sets of images. Before closing the database or taking a break?
It takes a bit longer then, but as you're enjoying your coffee or tea (or anything else...) it's not that important.

Ger

pajaro

Quote from: ColinIM on December 05, 2014, 07:45:46 PM
I hope I don't come across as being ungrateful for your hint Pavel  :) I'm just musing aloud on why Mario hasn't made this global variation on metadata write-back more accessible than it is (or than it seems to be). 

:)

Colin,

I think that what Ger suggests is a good idea. This is actually what I do - process all my images, switch to Collections and then let IMatch write the metadata.

Pavel.

StanRohrer

I use the Collections method.

Can some people here confirm another related concern?

With Write Back Changes Immediately turned off, if I Copy a file and Paste Attributes to another file, IM seems to still write the files immediately. I don't end up with a Pen icon. When I check the previously empty file IPTC fields I now find them filled (Open in Photoshop and check via File Info). At some point when I do have Pen icons I will get errors (I think related to the already written files).

This action would seem to take time in file writing that I'm trying to avoid with the Write Back Changes Immediately turned off.

[attachment deleted by admin]

Mario

Copying metadata between files is done via ExifTool - a direct file -> file transfer.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ColinIM

Quote from: Ger on December 05, 2014, 08:34:01 PM
Why don't you write-back metadata only when you're done with processing x sub-sets of images. Before closing the database or taking a break?
It takes a bit longer then, but as you're enjoying your coffee or tea (or anything else...) it's not that important.
Ger

Hi Ger, and acknowledging your later response too Pavel,

Yes, you make another fair point Ger.

I could always postpone all write-backs until the end of however-many sub-sets of images I need to process, and in my head - so to speak - I know this makes good sense, but I think it's simply about my preferred "style" of working. So (to switch into philosophical mode ...) I listen to my 'heart' too  ;D

On long, incremental jobs such as this one I get an irresistable 'itch' that needs to be 'scratched' if I make too much "progress" on the task which is in any sense "interim progress".  I feel I've made only interim progress until I've committed the data (written it 'back') to my images.

In other words, while I do know with near certaintly that IMatch will hold all my newly-entered data safely and snugly in its database tables and in its transaction threads etc. while I work (maybe for hours at a time); and I'm fairly sure that my recently-new PC hardware won't go 'fizzz...phut...' and lose (what could be) multiple hours' worth of my "interim progress" ... I really do need to scratch that 'itch' every once in a while and commit that work by writing-it-back to my image files.  My "progress" then, however small, feels more solid.

Maybe (just maybe ...) it's a "working pattern" hangover from my time in computer programming, where programmers soon learn the wisdom of pausing regularly to reflect-upon and to test the code they've just built - regardless of how 'lucid' or clever they're feeling at the time  :) A bit like doing a periodic 'checkpoint' on my work ... ?  (Switching out of philosophical mode ...)

So I suppose it's a "style thing", but yes, that Collections tab isn't far away, and I'm sure I'll 'warm' to it as I use it more and more.
Cheers again,
Colin P.

StanRohrer

Mario, Yes. Duh! I knew ExifTool was used but didn't think about the ramifications of it having to do an immediate full write when I was trying to save copy/paste time.

StanRohrer

Back to the OP by ColinIM....

Can the Menu / Commands / Metadata Write Back / All pending files,  be made into a Favorite that only takes one click? How does one make this Favorite? How does one make a Favorite from any Menu / Command?

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JohnZeman

Quote from: StanRohrer on January 15, 2015, 03:00:35 PM
Can the Menu / Commands / Metadata Write Back / All pending files,  be made into a Favorite that only takes one click? How does one make this Favorite? How does one make a Favorite from any Menu / Command?


You could create a simple 1 line script to writeback metadata and run that as a favorite.

SendKeys "%cr~a"

ColinIM

Quote from: JohnZeman on January 15, 2015, 07:48:02 PM
You could create a simple 1 line script to writeback metadata and run that as a favorite.
SendKeys "%cr~a"

Thanks John!

I've now added this as an extra Menu item under my Commands Menu  :)

I've named this new mini-Script "Sendkeys - Writeback all pending metadata" (and this is what appears on the Command Menu of course), so now I can quickly press just  ALT+c, w  at any time and click the 'OK' button, or press Enter, on the "Write-back Metadata" pop-up dialog box.

You mentioned an option to "run as a favorite" ... but perhaps you meant the option to assign a keyboard shortcut to this new script, via its Script Properties?

(I can't (yet) see a way to assign a script as a favorite. I searched and browsed the Help for scripts and for Favorites, and although the term "Scripts" is included as a bullet-pointed item on the "Working with Favorites" Help page, there's no explanation of how to do so on that page. I'll send Mario an auto-feedback note from that Help page in a few minutes.)

However, even though I have assigned a Keyboard shortcut to this new mini-script (I chose F8, w) I will still be choosing to access this new 'shortcut' via the IMatch main menu rather than as a Favourite (assuming a Favorite for the script is in fact feasible).  This is because IMatch always, always, always responds to a main menu item when it's invoked by an ALT-keystroke combination, whereas the F8 lead-in keystroke is "not seen" by IMatch unless I first move the program's 'input focus' back to the File Window.

(For clarity: that issue of "to which panel are 'F8' keystrokes directed" is emphatically not a criticism of how IMatch responds to keystrokes. Our keystrokes of course must be directed somewhere within the program - to one panel or another - and I'm not proposing that Mario adds a whole new layer of complication to our choice of shortcut keys - such as allowing us to select which panel should 'receive' each shortcut key!  I don't even think that would be feasible.)

So thank you again John. My workflow is now somewhat 'smoother', and I've had the bonus of extending my still-limited knowledge of IMatch's marvellous Scripting features  8)

Colin P.

JohnZeman

Quote from: ColinIM on January 15, 2015, 10:13:04 PM
(I can't (yet) see a way to assign a script as a favorite. I searched and browsed the Help for scripts and for Favorites, and although the term "Scripts" is included as a bullet-pointed item on the "Working with Favorites" Help page, there's no explanation of how to do so on that page. I'll send Mario an auto-feedback note from that Help page in a few minutes.)


Colin creating a favorite that runs a script is easy.  Just open the script manager panel then simply drag and drop the script you want to the favorites panel.

ColinIM

Ah! Super! I should have thought of that  ???

I've dragged-n-dropped happily in other IMatch contexts, and I'll now do this as an exercise  (though a brief one!) with this script to 'consolidate' it in my mind as an option for scripts too.

(Mario reminded me about this also when he acknowledged my 'Help' feedback/email, and he has already updated the relevant Help pages.)

Thanks again.

DigPeter

Quote from: JohnZeman on January 15, 2015, 07:48:02 PM
You could create a simple 1 line script to writeback metadata and run that as a favorite.

SendKeys "%cr~a"
John, could you please help me.  Scripting is over my head.  How do I get this script into the system?  (I have tried looking in the help topics.)

Thanks

JohnZeman

#16
Sure.  Open the Script Manager panel (View > Panels > Script Manager) then in the script manager click the create new script icon (see attached screen shot).  Give it a name and IMatch should create a new blank script that you can see in the script manager.  Select that new script and click the edit icon (pencil icon in my screen shot) to edit the script then paste the code in between the Sub Main and End Sub.  So it looks like the following.

Sub Main
SendKeys "%cr~a"
End Sub


Save it and you're done.  To assign that script to a favorite just drag and drop it to the favorites panel as mentioned above in my reply to Colin.

All the script does is to simulate IMatch keyboard shortcuts.  Any IMatch menu command that can be run with keyboard keys can be run with a script by simulating the pressing of those keyboard keys.  To see what the different symbols mean for keyboard characters, while you are editing your script in the script manager editor press F1 to open Basic Help (not the same as IMatch help) and search for the SendKeys Instruction help page.  In the simple script for Colin this is what happens when you run the script.

% Represents pressing the ALT key.
c represents pressing the C key.
r represents pressing the R key.
~ Represents pressing the ENTER key.
a represents pressing the A key.

Which is the keyboard combination it takes to run the IMatch Commands > Metadata Writeback > For all pending files menu command.

[attachment deleted by admin]

DigPeter

John - thank you so much.  It worked!

I am puzzled though about the heading "code" in your example, which I do not see in my  editor - see attachment.

Peter

[attachment deleted by admin]

JohnZeman

What do you mean by the heading code Peter?  This?

'#Language "WWB-COM"
Option Explicit


If so the first line defines the scripting language used while the second essentially means all variables in the script must be declared before being used.  The latter is an option that does nothing in this case because we're not using variables.

jch2103

Quote from: DigPeter on January 16, 2015, 05:57:59 PM
I am puzzled though about the heading "code" in your example, which I do not see in my  editor - see attachment.

If you're asking about the 'Code: [Select]' above John's code example, that's automatically provided by the Board software when you use the 'Insert Code' button when composing a post.
John

DigPeter

John & John
Thanks - yes I was referring to word "code".  Apparently not part of the scripting process.

JohnZeman

You're right Peter the "Code" you wondered about has nothing at all to do with scripting except to display script code in this forum as it actually is (without modifying it in any way).

DigPeter

I have been working on IM5 for 3+ years and still learning :-[