I am trying to find and easy way to make a selection (or label items) in one of our catalogs from a list of filenames in an excel spreadsheet (or any simple text listing). I've seen a Visual Basic script in the forums that seems to accomplish this for windows users. Any savy scripters out there with a solution?

If your Excel spreadsheet has the pathname, in MacOS format (colons instead of slashes), then this can help. First export the spreadsheet to plaintext -- e.g., as a .csv file.

The following applescript "Label if Path in..." will go through the selected items and label red all the items whose entire pathname appears somewhere in a given text file.

Code:

-- This command takes one or more catalog items, and then labels all the items whose pathnames appear in a designated text file.

-- by algal, on iView Media Forum

on run
-- get the list of selected ID's in front window
set itemsToProcess to GetSelection()

-- show about
AboutScript()

-- get the text file listing files to be marked
set tobemarkedFile to choose file with prompt "Choose a text file listing the pathnames of items to be labeled"
if tobemarkedFile = "" then return

-- read the contents of text file listing the files
tell application "Finder"
if exists file tobemarkedFile then
set refNum to open for access tobemarkedFile without write permission
if refNum is not 0 then
set content to read refNum
close access refNum
end if
end if
end tell

-- set the label of all items to 1
repeat with theItem in itemsToProcess
tell window 1 of application "iView MediaPro"
-- check if filename appears in content
set thePath to the path of theItem
if (offset of thePath in content) > 0 then
set theLabel to 1
set the label index of theItem to theLabel
end if
end tell
end repeat
end run

-- get the selected media items in an array
on GetSelection()
set selectedItems to {}
tell application "iView MediaPro"
if catalog 1 exists then set selectedItems to the selection of catalog 1
end tell
if number of items in selectedItems is 0 then
display dialog ¬
"You need to select at least one media item in the front catalog in order to use this script." buttons {"OK"} default button ¬
"OK" with icon note giving up after 10
error number -128
end if
return selectedItems
end GetSelection