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 

Add Filename to IPTC Caption or Source

 
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
roberte



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

PostPosted: Fri Sep 23, 2005 3:22 am    Post subject: Add Filename to IPTC Caption or Source Reply with quote

Sometimes I need to locate original RAW files when conversions have been renamed by clients. As long as the Caption isn't over-written (quite probable) or Source (safer option!) here are some scripts that help me by saving my original filenames as metadata:

Add Filename to IPTC Caption:
Code:
Option Explicit

Const kMsgBoxTitle = "iView MediaPro"
Dim app, mediaItems, mediaItem, strText

' display an about box
If (MsgBox("This command writes the Filename into the Caption.", 65, kMsgBoxTitle) = vbOk) Then
   Main()
End If

Sub Main()
   Set app = CreateObject("iView.Application")

   ' get the active catalog
   If (app.Catalogs.count = 0) Then
      MsgBox "Please launch iView MediaPro.", vbCritical, kMsgBoxTitle
   Elseif (app.ActiveCatalog.Selection.Count = 0) Then
      MsgBox "You need to select at least one media item in the active catalog in order to use this script.", vbCritical, kMsgBoxTitle
   Else
      For Each mediaItem In app.ActiveCatalog.Selection
         
         strText = ""
         If (mediaItem.Name <> "") Then strText = mediaItem.Name & vbCrLf End If
         
         If (strText <> "") Then
            mediaItem.Annotations.Caption = strText
         End If
                  
      Next

   End If

End Sub


Add Filename to IPTC Source:
Code:
Option Explicit

Const kMsgBoxTitle = "iView MediaPro"
Dim app, mediaItems, mediaItem, strText

' display an about box
If (MsgBox("This command writes the Filename into the IPTC Source.", 65, kMsgBoxTitle) = vbOk) Then
   Main()
End If

Sub Main()
   Set app = CreateObject("iView.Application")

   ' get the active catalog
   If (app.Catalogs.count = 0) Then
      MsgBox "Please launch iView MediaPro.", vbCritical, kMsgBoxTitle
   Elseif (app.ActiveCatalog.Selection.Count = 0) Then
      MsgBox "You need to select at least one media item in the active catalog in order to use this script.", vbCritical, kMsgBoxTitle
   Else
      For Each mediaItem In app.ActiveCatalog.Selection
         
         strText = ""
         If (mediaItem.Name <> "") Then strText = mediaItem.Name & vbCrLf End If
         
         If (strText <> "") Then
            mediaItem.Annotations.Source = strText
         End If
                  
      Next

   End If

End Sub


And don't forget to sync annotations!
_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
Citezein



Joined: 22 Apr 2005
Posts: 86

PostPosted: Thu Nov 03, 2005 10:55 pm    Post subject: Reply with quote

I believe keeping the file name is exactly what the IPTC Core field "Title" is for. Obviously it should be easy to modify the script to use that field instead.
Back to top
View user's profile Send private message Visit poster's website
rfreschner



Joined: 03 Nov 2005
Posts: 71
Location: Andover, CT USA

PostPosted: Fri Nov 11, 2005 7:58 pm    Post subject: Reply with quote

Citezein wrote:
I believe keeping the file name is exactly what the IPTC Core field "Title" is for. Obviously it should be easy to modify the script to use that field instead.


In the v3 manual, it looks like IVMP equates Product to Object Name, the IIMv4 equivalent of Title.
_________________
Rick
Dell XPS 600, XP ME 2005, PD 3.0 GHz, 2G RAM
HP Pavilion, XP Pro SP2, P4 3.0 GHz, 1G RAM
MS EM 1.0.8076.0
Back to top
View user's profile Send private message
wim



Joined: 04 Jan 2006
Posts: 4

PostPosted: Wed Jan 04, 2006 11:07 am    Post subject: Reply with quote

Hi,

I changed the script, because you must not change the source text but the title text.
Further I removed a contrl linefeed that couses problems. It ads two ascII characters after the text and thats not nessecary. Here is an update:

Option Explicit

Const kMsgBoxTitle = "iView MediaPro"
Dim app, mediaItems, mediaItem, strText

' display an about box
If (MsgBox("This command writes the Filename into the IPTC Source.", 65, kMsgBoxTitle) = vbOk) Then
Main()
End If

Sub Main()
Set app = CreateObject("iView.Application")

' get the active catalog
If (app.Catalogs.count = 0) Then
MsgBox "Please launch iView MediaPro.", vbCritical, kMsgBoxTitle
Elseif (app.ActiveCatalog.Selection.Count = 0) Then
MsgBox "You need to select at least one media item in the active catalog in order to use this script.", vbCritical, kMsgBoxTitle
Else
For Each mediaItem In app.ActiveCatalog.Selection

strText = ""
If (mediaItem.Name <> "") Then strText = mediaItem.Name
End If

If (strText <> "") Then
mediaItem.Annotations.Product = strText
End If

Next

End If

End Sub



thanks for Roberte who maked the original script. I'm not able to write a vb-script , but to make a change is easier.

Wim
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: Tue Jan 16, 2007 10:56 am    Post subject: Reply with quote

Hi Wim,

Moving an End if on line 23 stopped the script working on my machine. Here's the marriage of both codes that writes filename to IPTC Title:
Code:
Option Explicit

Const kMsgBoxTitle = "iView MediaPro"
Dim app, mediaItems, mediaItem, strText

' display an about box
If (MsgBox("This command writes the Filename into the IPTC Title.", 65, kMsgBoxTitle) = vbOk) Then
Main()
End If

Sub Main()
Set app = CreateObject("iView.Application")

' get the active catalog
If (app.Catalogs.count = 0) Then
MsgBox "Please launch iView MediaPro.", vbCritical, kMsgBoxTitle
Elseif (app.ActiveCatalog.Selection.Count = 0) Then
MsgBox "You need to select at least one media item in the active catalog in order to use this script.", vbCritical, kMsgBoxTitle
Else
For Each mediaItem In app.ActiveCatalog.Selection

strText = ""
If (mediaItem.Name <> "") Then strText = mediaItem.Name End If

If (strText <> "") Then
mediaItem.Annotations.Product = strText
End If

Next

End If

End Sub

_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
wim



Joined: 04 Jan 2006
Posts: 4

PostPosted: Wed Jan 17, 2007 11:16 am    Post subject: Reply with quote

Hi Roberte,

Ok, this works fine.
I noticed that after a upgrade a while ago, that the script caused problems. I had also made some changes to.

The last script you posted works fine....

An other question.... do you change IPTC headers also in RAW files for exemples if you use nikon.... the NEF files?
I'm afraid it causes maybe problems in the future, beacuse of the possibility that nikon changes the NEF file structure.... I now, that iview is using the origanal libraries but............
you never know...


regards
wim
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 Jan 17, 2007 9:07 pm    Post subject: Reply with quote

Hi Wim,

Yes I do sync to NEF files.

The funny thing is I currently have a support case open with iView regarding this. Phase One loses the white balance info on some NEF files annotated and synchronised in iView. It is only C1 that has the issue but still a PITA.

AFAIK C1 doesn't have the same problem with NEF files annotated in Nikon View. So you are wise to be cautious.
_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
wim



Joined: 04 Jan 2006
Posts: 4

PostPosted: Thu Jan 18, 2007 4:01 am    Post subject: Reply with quote

Hi Robert,

Hmmm, that's indeed a PITA.
I struckle with this problem a long time. I like the idea to put all my IPTC right away in the NEF. But.... I have troubles in the past too, even with capture versions. I even change the NEF's with whitebalance, curves etc etc. Now I change it too with Capture NX, even more with partitional sharpness, colorchanges etc etc. What if NIKON goes about some years totaly the other way and do not incorporate with NIK anymore? You never can tell with NIKON because it's a bunch of arrogant people there.
I'm considering now to keep two set of files, one original NEF and the NEF for archive, but that's a lot of harddiskspace : -((((

How is your workflow about that.....?

Regards
Wim
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 Jan 18, 2007 8:35 am    Post subject: Reply with quote

Hi Wim,

You could backup untouched NEFs to read-only media such as DVD and have copies on HDD. Those on the hard drives can be annotated and used as masters. If a problem arises in the future you can go back to the DVD copies. FWIW I would add another HDD backup making three copies altogether with one stored off site. Hard disk space is cheap.

I like to believe if Nikon do go the way of Minolta that they would openly document the NEF format.
_________________
-- Robert
Expression Media 2 / Windows 8 / Mac OS X 10.10
Back to top
View user's profile Send private message Visit poster's website
wim



Joined: 04 Jan 2006
Posts: 4

PostPosted: Thu Jan 18, 2007 9:53 am    Post subject: Reply with quote

Hi Robert,

Indeed, I use already two HDD to backup my photo's. But I must backup the untouched NEF's also... I think I will do that in the future. It's to risky.

It has also another advantage... anotation with iview IN raw files is easier then nikon capture.. I make most of the time naturephoto's and I want write the dutch, englisch and scientific names in the NEF's.
Breeze has a very nice way to anotate but I do not write it in the NEF with breeze because they do not use the origanal nikon libraries . Breeze make use of an external txt file. In this txt file I have the names on 1 line and can select 1 line at once.That'sa very quick way. Iview do not have that future but it works faster than anotating in capture..

reagrds
wim
www.naturephotography.nl
Back to top
View user's profile Send private message Visit poster's website
christy



Joined: 18 Jan 2007
Posts: 1

PostPosted: Fri Jan 19, 2007 5:50 pm    Post subject: Reply with quote

whatever happened to jon... does he come here anymore?
_________________
Writing Resume Cover Letter
Back to top
View user's profile Send private message Visit poster's website
emccainaz



Joined: 28 Jun 2004
Posts: 24
Location: Tucson, Arizona, USA

PostPosted: Tue Jan 23, 2007 7:03 pm    Post subject: Applescript error message Reply with quote

I am trying to compile the latest version of this script, but get a message from the Script Editor: "Syntax Error, A identifier can't go after this identifier" I have no experience with AppleScript and so have no idea how to fix this. Can anyone clue me in on a fix?

I need to copy my actual filename to the Title field of iVMP v3.

Thanks,

Edward McCain
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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