Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/content/60/9972860/html/smf/Sources/Load.php(225) : runtime-created function on line 3

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/content/60/9972860/html/smf/Sources/Load.php(225) : runtime-created function on line 3
Print Page - Find files from List

The DAM Forum

Software Discussions => Media Pro & Expression Media => Topic started by: Nick Rains on March 29, 2009, 09:25:43 PM



Title: Find files from List
Post by: Nick Rains on March 29, 2009, 09:25:43 PM
Hi

Does anyone know how to select or find files in an xMedia database from a text or spreadsheet list?

A client has sent me a big list of images that they want, but listed as a spreadsheet. It seems to me that there should be some way to do a Find/Select based on matching a file name to those in that list - ie Find = True IF string is contained in text file. I can easily export a comma-delimted txt file from the spreadsheet, I just need some way to match the image file names to names in the list.

Any ideas?

Nick Rains


Title: Re: Find files from List
Post by: matthewjheaney on March 30, 2009, 09:36:01 AM
I would use ADO to read the spreadsheet, similar to what is described here:

http://www.microsoft.com/technet/scriptcenter/resources/officetips/jun05/tips0607.mspx

Use the names you pull from the spreadsheet as keys to populate a Scripting.Dictionary object.

Iterate over the media items in the catalog, and test whether the name of the media item appears in the dictionary.  If so, select the media item.

If you need some help writing the script, just drop me a line.

Cheers,
Matt

http://home.earthlink.net/~matthewjheaney/damtools/index.html



Title: Re: Find files from List
Post by: Nick Rains on March 30, 2009, 03:11:31 PM
I'd really appreciate some help here - I know very little about proper scripting, my efforts so far have been limited to modifying existing xMedia scripts for metadata copying from one field to another.

Like many things, this sort of task is 'very hard' if you don't know how to do it and 'easy' if you do.

I'd be very happy to work out a script that could test a record to see if the file name is contained in a list of words (file name list) and then write some marker to the metadata for later extraction using the usual xMedia functions like 'find'

I am not at the level of coding where those links you kindly referred to actually mean much to me. I dare say, with a bit of time, I could learn them but its also possible it would take longer to do this than to manually work through my list of files.


Title: Re: Find files from List
Post by: matthewjheaney on March 30, 2009, 03:55:50 PM
I'd be very happy to work out a script that could test a record to see if the file name is contained in a list of words (file name list) and then write some marker to the metadata for later extraction using the usual xMedia functions like 'find'

Yes, that would be relatively simple:

Use the Scripting.FileSystemObject to open the text file containing list of image files, and use those names a keys in a Scripting.Dictionary object.

Then, iterate over the files in the catalog, and test the name to see if it's present in the dictionary.  If so, you could either select it, or apply a label to it, or rate it, etc.

If you want, you can send me the file list (in whatever form it is), and I can probably whip up a script quickly.  If it's general enough, I can incorporate the script into my Expression Media scripts package (available from my website).  Otherwise, you could study my scripts for ideas.

-Matt

http://home.earthlink.net/~matthewjheaney/damtools/index.html



Title: Re: Find files from List
Post by: Nick Rains on March 30, 2009, 04:23:31 PM
I've emailed you an xls file as sent to me by my client.

If you can give me the bare bones of a script I can probably adapt it - it's the syntax and structure that I have problems with, I can usually work out what they do.

I figure it could be quite useful to others to be able to make a selection from a text list of file names. I'm always surprised how many big image companies and publishers have no idea about DAM etc. They all have their own proprietary systems and expect you to work with that no matter how much extra work that means. I send these guys an iView Reader app and catalog - they could have sent me a markup but they sent me this instead!

Cheers

Nick


Title: Re: Find files from List
Post by: matthewjheaney on March 30, 2009, 09:25:14 PM
If you can give me the bare bones of a script I can probably adapt it - it's the syntax and structure that I have problems with, I can usually work out what they do.

Hello Nick,

I just mailed you a script.  Try it out and drop me a line if you have any comments or questions.

Cheers,
Matt