Re: Script to copy category assignment
"vlukinius" <[email protected]> Mon, 24 Jan 2005 22:41:29 -0000
| Newsgroups | gmane.comp.graphics.imatch |
|---|---|
| Message-ID | <[email protected]> |
Thank you both for the help. With your help I created the Sub I needen for my script. The complete eded up looking like this (if you are interested): Sub CopyCats(FromFile As String, ToFile As String) Dim db As Database Dim Cat As Category Dim From_Cats As Categories Dim FromImg As Image Dim ToImg As Image Set FromImg = db.GetImages(FromFile) Set db = Application.ActiveDatabase Set ToImg = db.GetImages(ToFile) Set From_Cats = FromImg.Categories For Each Cat In From_Cats Cat.AddImage(ToImg) Next Cat Set db = Nothing Set From_Cats = Nothing Set FromImg = Nothing Set ToImg = Nothing End Sub --- In [email protected], "Pete Poorman" <ppbiz- yahoo@p...> wrote: > The CreateWorkingCopy script copies both categories and properties > (including reference properties) from one image to another. It's in the > download area of the Yahoo group. Feel free to borrow code from it. > > I have yet to update this script for the latest iMatch version (sorry gang), > but all that's required is to run it and remove the trailing "s" from the > types that Mario changed. See the release notes on the photools web site > for details. > > -- Pete > > -----Original Message----- > From: mcaraba [mailto:mcaraba@h...] > Sent: Tuesday, January 18, 2005 12:45 PM > To: [email protected] > Subject: [imatchuserforum] Re: Script to copy category assignment > > > > > Is there a way how to copy the properties too? > > --- In [email protected], "Calvin Hass" <speedcal@h...> > wrote: > > > > vlukinius <salsa_pacos <at> hotmail.com> writes: > > > > > Is there anyone who knows how to copy the category assignmnet from > > > one picture to another using vbscript (sax basic)? > > > > > > I just need a script snippet. > > > > The following is an really quick example of it: > > > > Dim imgs As Images > > Set db = Application.ActiveDatabase > > Set imgs = db.GetImages > > Dim src_img As Image > > > > ... locate the destination image (the following uses all in database) > > > > For Each src_img In imgs > > > > Set src_cats = src_img.Categories > > > > ... find destination image (dst_img) > > > > For Each cat In src_cats > > cat.AddImage(dst_img) > > Next cat > > > > Next src_img > > > > Hope that helps! > > Cal. > > --- > > http://www.impulseadventure.com/photo/ > > Digital Photography Workflow > > > > > > > Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/imatchuserforum/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/