iView home page
iView Multimedia Forum Index

FAQ FAQ     SearchSearch     MemberlistMemberlist     UsergroupsUsergroups    RegisterRegister  
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Catalog sets to keywords

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    iView Multimedia Forum Index -> VB Script
View previous topic :: View next topic  
Author Message
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue Apr 18, 2006 9:42 am    Post subject: Catalog sets to keywords Reply with quote

Here's a proof of the concept of updating the keywords from a keywords hierarchy in a catalog sets. You need a catalog set called "Keywords" (you can change this easily), with media items assigned to its subsets. I've tested it with 3 levels of subsets - firstly an A-Z, then individual keywords.

Any thoughts? Does this look promising?

John

Code:
'========================================================================================
'by John Beardsworth 18/4/06
'version 1.0 now replaced


Last edited by johnbeardy on Tue Apr 18, 2006 4:42 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue Apr 18, 2006 4:41 pm    Post subject: Reply with quote

Version 1.1 picks up keywords higher up the tree. Still in development...

Code:

'========================================================================================
'by John Beardsworth 18/4/06
'version 1.1 already replaced


Last edited by johnbeardy on Tue Apr 18, 2006 5:50 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue Apr 18, 2006 5:48 pm    Post subject: Reply with quote

Fixing a problem:

Code:
'========================================================================================
'by John Beardsworth 18/4/06
'version 1.2
'Loops through catalog sets and looks for a level 0 catalog set called "keywords"
'then, until there's another level 0 set, the variable ivKeywords is true
'if ivKeywords is true, the set names are then copied to the media items' keywords
'========================================================================================

   
   Const ivKeywordSetName = "Keywords"

   Set ivApp = CreateObject("iView.Application")
   If (ivApp.Catalogs.Count = 0) Then
        MsgBox "Please launch Iview MediaPro.", vbCritical, kMsgBoxTitle
   else
      Main
   end if


Sub Main()
    Set ivApp = CreateObject("iView.Application")
    Set ivCat = ivApp.ActiveCatalog
    Set ivSets = ivCat.MediaSets
    Dim ivKeywordLevels(10)
       
    ivKeywords = False

    For Each i In ivSets
       Set ivSet = i
       
       If i.Name = ivKeywordSetName And i.Level = 0 Then
       ivKeywords = True
       ivPrevlevel = 0
       ElseIf i.Level = 0 Then
       ivKeywords = False
       End If
       
       If ivKeywords = True And i.Name <> ivKeywordSetName Then
       'if the current level is less than or equal to the previous level
       'purge the previous one's children
            If i.Level <= ivPrevlevel Then
            For iv = i.Level To UBound(ivKeywordLevels)
            ivKeywordLevels(iv) = ""
            Next
            End If
            ivKeywordLevels(i.Level) = i.Name
            ivPrevlevel = i.Level
            ivLevelNames = ""
            For Each ivLevelName In ivKeywordLevels
                If ivLevelName <> "" Then
                ivLevelNames = ivLevelNames & ";" & ivLevelName
                End If
            Next
           
            On Error Resume Next
            If i.MediaItems.Count > 0 Then
            For Each j In i.MediaItems
                If j.Selected = True Then
                j.Annotations.Keywords = j.Annotations.Keywords & ";" & i.Name & ivLevelNames
                End If
            Next
       End If
       
       End If
    Next
Set ivApp = Nothing
msgbox "done"
End sub
Back to top
View user's profile Send private message Visit poster's website
roberte



Joined: 18 Jun 2004
Posts: 2147
Location: Sydney, Australia

PostPosted: Thu Apr 20, 2006 11:51 pm    Post subject: Reply with quote

Hi John,

Maybe we add "the Baptist" to your name :). I go on a weeks hiatus and you work a miracle!

Your Catalog sets to keywords script works perfectly for me. I'm only testing on Sets three levels deep at this stage. If this works it will change my workflow.

Thanks mate.

-- Robert.
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Fri Apr 21, 2006 5:43 am    Post subject: Reply with quote

Hi Robert

It's close, and I've tested it on hundreds of items with a 6 level deep structure. However I think the script fails when items are assigned to a branch as well as to its leaves. To see this, you need to set up a 3 level set - here I used Keywords / Travels / Italy / Tropea with no items assigned to Travels, 1 to Italy, and 2 to Tropea. What's happening is that the Italy subset is detected, but the code fails when it tries to count how many items are attached. At the Tropea leaf, it works correctly. I believe I'm hitting a bug in the VB model's MediaSet object - when a set has subsets, MediaSet.MediaItems.Count falls flat on its face.

So don't change the workflow yet. I've asked technical support for help here because I think it could be that useful for Windows users to get the VB engine updated in this area. After all, Windows users wouldn't know what to do with a Universal Binary, would we?

I'd much prefer a character from the "Life of Brian" :)

John
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Fri Apr 21, 2006 12:44 pm    Post subject: Reply with quote

Anyway, not getting too theological here, but didn't you mean Evangelist? It bugged me all morning! Wasn't the Baptist into ducking folks' heads in the river?

John
Back to top
View user's profile Send private message Visit poster's website
gavingough



Joined: 08 Mar 2006
Posts: 23
Location: UK

PostPosted: Tue Apr 25, 2006 7:00 pm    Post subject: Reply with quote

John

I'm going to find this script enormously useful for keywording from a hierarchical structure. I'm a convert from iMatch and this functionality is the one thing that I missed most from that application.

I'm setting up Catalog Sets in a hierarchical structure and also including synonyms separated by commas in the Catalog Set names. So, for example:

Europe, EU
- United Kingdom, UK
- - England
- - - Hampshire, Hants

Which produces discrete keywords of Europe, EU, United Kingdom, UK, England, Hampshire, Hants with your script.

Invaluable! Just wanted to say thanks, err, Harry The Haggler?
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue Apr 25, 2006 7:43 pm    Post subject: Reply with quote

Gavin

Glad it's useful. Do watch out for the problem I mentioned about leaves and branches a couple of posts up. I believe there's a bug in this area and I'm following it up directly with iView.

Also remember my "Keywords from place finder" script here. For geographical annotations, that may be more appropriate and controllable - the Place Finder is already hierarchical and corresponds to iptc fields.

John
Back to top
View user's profile Send private message Visit poster's website
gavingough



Joined: 08 Mar 2006
Posts: 23
Location: UK

PostPosted: Tue Apr 25, 2006 7:50 pm    Post subject: Reply with quote

John

Thanks. Actually I do use your script to generate keywords from the Place Finder but the example that I originally used in my post was for a Wood Anenome and I couldn't find the correct Latin name to include as the synonym so gave in to my impatience and used the geographical example instead.

Now I just have to figure out how to get my iMatch thesaurus into iView Catalog Sets without retyping it all.

I think it's time to open a bottle of red.

Cheers!
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue Apr 25, 2006 8:12 pm    Post subject: Reply with quote

Gavin

Do you want to get the "tree" into iView, without assigning any images to the leaves and branches? One way might be to assign them all to a dummy image using Bridge and the iView panel in File Info. You'd first need to build a text string such as "Plants| Roses, Anemone" but with more branches - sync some metadata back to an image and then go to Bridge to see how iView records it. I'd build the text in Excel using the "&" to add text from two or more cells, then paste the result into Bridge. Then import the mule image (use a jpeg) into iView.

A bottle of (Spanish) red's half empty here as I watch the Arsenal game....

John
Back to top
View user's profile Send private message Visit poster's website
gavingough



Joined: 08 Mar 2006
Posts: 23
Location: UK

PostPosted: Tue Apr 25, 2006 10:32 pm    Post subject: Reply with quote

I'm not sure that mixing wine and iView is a good idea - what the heck, let's open another bottle and give it a go.

I'll let you know if I succeeded or not when I'm sober.

Cheers (Hic!)
_________________
Gavin Gough Photography
Back to top
View user's profile Send private message Visit poster's website
roberte



Joined: 18 Jun 2004
Posts: 2147
Location: Sydney, Australia

PostPosted: Wed Apr 26, 2006 6:35 pm    Post subject: Reply with quote

Hi John,

Do watch out for the problem I mentioned about leaves and branches a couple of posts up. I believe there's a bug in this area and I'm following it up directly with iView.

FWIW there are similar issues with those using Applescript to achieve the same task. After three levels of Sets the keywords don't transfer.

I fear it may go deeper than simply iView and VB. Then again, I'm getting scared of stuff I know nothing about :).

-- Robert.
Back to top
View user's profile Send private message Visit poster's website
superben



Joined: 17 Nov 2005
Posts: 2

PostPosted: Tue May 02, 2006 10:01 am    Post subject: Reply with quote

Hi there,

I am currently evaluating MediaPro 3 and still have some questions about realizing a hierarchical keyword structure using catalog sets.

1. The manual says that catalog set information can be synchronized to a "custom XMP annotation field". Does this work for DNG-files, too?

2. How do you manage to use the VB script "catalog sets -> keywords" in a bilingual setting; could you name a catalog subset "wedding, Hochzeit" for example and have these two entries written to keywords?

3. If synchronizing catalog set information to XMP annotation fields works, why should you write this information script-based to keywords at all? If I do so, will these keywords occur twice in the file after synchronizing?

I hope, these questions are not too stupid?!

Any hints are appreciated!

Thanks,

Ben
Back to top
View user's profile Send private message
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Tue May 02, 2006 11:38 am    Post subject: Reply with quote

1. Yes, the set metadata is written to XMP for any format that supports XMP, so that includes DNG, PSD, TIF, JPG etc.

2. Each word could be a "leaf" and the image would be dragged to both leaves. Or one word might be a branch and the other a leaf on it.

3. It's true that keywords will be in the catalogue file and synchronized to the original twice, but that's not much space. Some people like to enter keywords in a hierarchical format partly because it's easier to manage than a long list of hundreds of keywords, and it allows them to easily enter lots of synonyms.

Also look at the Vocabulary Editor and comma-separated entries, and at metadata templates. Using these tools flexibly is the key to entering the maximum relevant and consistent metadata with the least effort. SO yuo might have a general wedding template with keywords like hochzeit, matrimonio, wedding etc, and then save a variation of it for specific weddings.

If you are evaluating the product I'd advise you not to spend too much time on this. Hierarchical keywords are something that iView know their users want and a built in solution will come before long which will push my script to one side. You'd be better off testing iView's built in features while noting that such extensions and efficiency improvements can be added.

John
Back to top
View user's profile Send private message Visit poster's website
superben



Joined: 17 Nov 2005
Posts: 2

PostPosted: Tue May 02, 2006 10:12 pm    Post subject: Reply with quote

Hi John,

thanks for your super-fast and comprehensive answer!

I just asked these things because I am setting up my whole workflow (from scratch) and wanted to clarify the keyword process and how this can be realized with MediaPro.

But as you said, there is much more to explore and to set up - I will go on playing around with all the other features right away...

Thanks again,

Ben
Back to top
View user's profile Send private message
Paul Wood



Joined: 30 Dec 2005
Posts: 14

PostPosted: Wed May 03, 2006 7:47 pm    Post subject: Reply with quote

gavingough wrote:
I'm a convert from iMatch and this functionality is the one thing that I missed most from that application.

I'm setting up Catalog Sets in a hierarchical structure and also including synonyms separated by commas in the Catalog Set names. So, for example:

Europe, EU
- United Kingdom, UK
- - England
- - - Hampshire, Hants

Which produces discrete keywords of Europe, EU, United Kingdom, UK, England, Hampshire, Hants with your script.



I'm also an Imatch convert, and I was initially very excited by this. However, I am a high volume shooter, and because of the advice of Peter Krogh and The DAM Book, I'm using one catalog per year.

So if I build up a nice, detailed hierarchical structure of catalog sets and then start a new catalog next year, it appears that I'll have to start anew. I don't see a way to copy the catalog sets -- without copying all the images -- into a new catalog.

Am I mistaken, and there's an easy way to do this?

-- Paul
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Wed May 03, 2006 7:50 pm    Post subject: Reply with quote

Copy the catalogue file and delete all the files from the copy. The sets structure remains.

Peter's advice re yearly catalogues is only because of the need to work around the 2Gb file size limit. If that didn't exist, he would use a single catalogue.

John
Back to top
View user's profile Send private message Visit poster's website
garethjjones



Joined: 01 Nov 2004
Posts: 58

PostPosted: Wed May 10, 2006 7:53 am    Post subject: cat sets to keywords Reply with quote

I can't get this to work!

Screen shot of the catalogue structure attached.


It appears to detect the top level catalogue set ok, but refuses to create the keywords
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Wed May 10, 2006 8:20 am    Post subject: Reply with quote

I'll give it a test later. That structure should work as it's similar to one I used for testing. Are you selecting items before running the script?

John
Back to top
View user's profile Send private message Visit poster's website
garethjjones



Joined: 01 Nov 2004
Posts: 58

PostPosted: Wed May 10, 2006 8:59 am    Post subject: Reply with quote

Ahh, that wasn't clear. Just tried it again, and selected all the images, and I've got keywords.

Guess I shouldn't try things so late at night as last night!

regards

Gareth
_________________
gareth

www.sports-alive.com
www.smart-pictures.co.uk
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
wparsons



Joined: 06 Jul 2006
Posts: 2
Location: Michigan

PostPosted: Thu Jul 06, 2006 1:18 am    Post subject: Reply with quote

Hi John. I'm hoping you can clarify the bug you mentioned. Are you saying the issue occurs when you assign the same photo to both a branch and one of its leaves? Or do you mean it occurs when you assign any photo to a branch and any other photo to one of its leaves?

Any information on this, or an update on this script's status in light of the 3.1.1 update (if any changes) would be most appreciated.

-- Warren
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Thu Jul 06, 2006 5:50 am    Post subject: Reply with quote

wparsons wrote:
Or do you mean it occurs when you assign any photo to a branch and any other photo to one of its leaves?


It's this. It's acknowledged as a bug but I've not tested it recently.

John
_________________
PC and Mac too
iView scripts & utilities
Back to top
View user's profile Send private message Visit poster's website
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Thu Jul 06, 2006 11:35 am    Post subject: Reply with quote

As an update, I've just tested this area and there's no change from my previous findings. iView have acknowledged bugs in this area and I've recently given them a priority list for VB work - the bugs here were top of the list. So let's hope we won't have to wait long for a fix, certainly not until a full VBA editing environment becomes one of the fruits of Microsoft's ownership.

John
_________________
PC and Mac too
iView scripts & utilities
Back to top
View user's profile Send private message Visit poster's website
wparsons



Joined: 06 Jul 2006
Posts: 2
Location: Michigan

PostPosted: Thu Jul 06, 2006 4:15 pm    Post subject: Reply with quote

Thanks a bunch for the clarification, John!

Even with this quirk, I may have a place in my workflow for this script.
Back to top
View user's profile Send private message Visit poster's website
drmrbrewer



Joined: 24 Sep 2005
Posts: 510
Location: UK

PostPosted: Thu May 31, 2007 11:28 am    Post subject: Reply with quote

johnbeardy wrote:
iView have acknowledged bugs in this area and I've recently given them a priority list for VB work - the bugs here were top of the list. So let's hope we won't have to wait long for a fix


OK, nearly a year on... and any fix?

Mike
Back to top
View user's profile Send private message
Dierk



Joined: 14 Jan 2005
Posts: 630
Location: Hamburg (Germany)

PostPosted: Thu May 31, 2007 11:33 am    Post subject: Reply with quote

Two takes on this:

1. With Microsoft acquiring iView VB Script bugs should be squashed in no time.

2. With MEM v1 being the bug fix version that it is ...*




*If I have to spell this out ...
_________________
xMedia v2 on Windows XP/SP2; 3.4 GHz, 2 GB RAM, loads of storage space.
Other: Nikon D2x, Nikon D200, Breeze DownloaderPro, Capture NX, Adobe CS3 Design Premium
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
johnbeardy



Joined: 22 Nov 2004
Posts: 1137
Location: Dulwich, South ("Sarf") London

PostPosted: Thu May 31, 2007 3:00 pm    Post subject: Reply with quote

No change when I last tested.

I'd love to think MS will put a full VBA editor behind MEM (just like iMatch has the Sax basic editor). We'd have user dialog boxes and full control of every aspect of the user interface, just like Excel. Some may say I'm a dreamer.....

John
_________________
PC and Mac too
iView scripts & utilities
Back to top
View user's profile Send private message Visit poster's website
drmrbrewer



Joined: 24 Sep 2005
Posts: 510
Location: UK

PostPosted: Thu May 31, 2007 3:49 pm    Post subject: Reply with quote

... but you're not the only one.

Surely there must be something good in the pipeline for that $100 premium over MediaPro?

Mike
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    iView Multimedia Forum Index -> VB Script All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



  © iView Multimedia Ltd. | All Rights Reserved Privacy Policy | Copyright | Site Map