• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Coerce file reference to text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coerce file reference to text


  • Subject: Re: Coerce file reference to text
  • From: Sam <email@hidden>
  • Date: Mon, 15 May 2006 12:28:34 -0400

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


On May 11, 2006, at 3:00 PM, email@hidden wrote:

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


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Application (Universal)
  • Next by Date: Font cache id number
  • Previous by thread: Re: Coerce file reference to text
  • Next by thread: how to create table in TextEdit using applescript
  • Index(es):
    • Date
    • Thread