Re: Set Selection with a list of items
Re: Set Selection with a list of items
- Subject: Re: Set Selection with a list of items
- From: Irwin Poche <email@hidden>
- Date: Sat, 06 Oct 2001 13:49:53 -0500
My mistake. The failure is not at compile time but run time - as soon as
the "set selectionItems to" is executed.
Let me recap...
The script will display two folders (each from a different disk, laptop and
desktop) and select certain identically named items(s) in each folder. The
lists it will work from are (and what's shown here is shortened from what it
will eventually be)...
set {laptopDisk, desktopDisk} to {"TiBook:", "G4:"}
set desktopFoldersList to {,
"System Folder", ,
"Documents:Microsoft User
Data:Identities", ,
"System Folder:Preferences"}
set laptopFoldersList to {,
"System Folder", ,
"Documents:Microsoft User
Data:Identities", ,
"System Folder:Preferences"}
set selectionItems to {,
{ "Note Pad File", "Scrapbook File"}, ,
"Main Identity", ,
"Hosts"}
User will make a selection indicating which of the nth elements of lists to
be passed...
my PresentFolder(desktopDisk, item idx of desktopFoldersList, item
idx of selectionItems, "left")
my PresentFolder(laptopDisk, item idx of laptopFoldersList, item idx
of selectionItems, "right")
The PresentFolder handler is defined as
on PresentFolder(aDisk, theFolder, theItems, left_right)
After opening and positioning the folders it will select the appropriate
item(s)...
if class of theItems is list then
select theItems of folder theFolder --fails
else
select item theItems of folder theFolder
end if
So far the only way I (and with your assistance) have been able to get the
"--fails" line to work is by hardcoding the names shown in the lists above.
Not a workable solution.
While I want to believe there's a single statement that will get the list of
items selected, I can't guess what it is. Perhaps not. Adding "items" to
the list assignment statements causes them to fail when they're executed.
I've also tried a loop to select them individually but, predictably, only
the last item remains selected. I don't know what form of a Finder select
statement will add to an existing selection.
So that's where I now stand,
-Irwin