First thanks to Melissa, Kai, Peter, Emmanuel, Chris, and others for responding to my query. I've gotten further but think that I'm caught in a hierarchy trap.
The POSIX path part of the script is working, but I also need the file reference as well because I want the comments of each file, as well as getting Quark to open each file to get some values from it.
What doesn't work:
tell application "Finder" set UserResponse to (choose folder) as string set filelistY to (every file of folder UserResponse whose file type contains "XPR") repeat with m from 1 to count of filelistY set barnwell to comment of (item m of filelistY as alias) as string end repeat tell application "System Events" set filelist to POSIX path of every file of folder UserResponse whose file type contains "XPR" repeat with i in filelist
get comment of (item 1 of filelistY as alias) as string end repeat -- i end tell --system events end tell --finder
I'm hoping you see that I have a list of file references in filelistY via the finder.
But I'm using System Events to get that same list of files into POSIX paths.
My efforts to use POSIX paths as reference to the comments of a file failed.
I have tried to do a separate repeat as suggested but it seems that I cannot pull from the barnwell variable within the filelist repeat block. It cannot get that string I set aside with the barnwell variable.
Take out the get comment line and the above works.
The reason I want the file comment is because I will use it with the filename to create a unique ID. If you have a better way for a unique file ID on a server, I'm ready.
But I still need to understand what I'm not doing right on the the hierarchy.
thanx, sam
Date: Thu, 11 May 2006 09:13:05 +0200 From: Emmanuel <email@hidden> Subject: Re: Coerce file reference to text To: email@hidden Message-ID: <p06230900c088941fd420@[192.168.2.2]> Content-Type: text/plain; charset="us-ascii" ; format="flowed"
At 3:05 PM -0400 5/10/06, Sam wrote: set filelist to POSIX path of every file of folder UserResponse whose file type contains "XPR"
I don't think Finder nor System Events can handle that kind of reference: "POSIX path of every file blah". I would try not to apply "POSX path" to a set of files. Rather, I would apply it to each file in a loop.
Emmanuel
|