Re: Variable declaration
Re: Variable declaration
- Subject: Re: Variable declaration
- From: Andrew Oliver <email@hidden>
- Date: Mon, 21 Jun 2004 10:00:14 -0700
Simple.
You're making this a lot, lot harder than it needs to be.
You're trying to get a list of filenames coerced to text and build a list of
paths which you pass to QXP. A far simpler setup would be to simply:
>
set folderPath to "Disk:Folder:Folder:" --wherever your folder is
>
tell application "Finder"
>
set theFiles to (every file in folder folderPath)
>
repeat with theFile in theFiles
>
open file theFile using application file id "XPR3"
>
...
In this model you get 'every file in folder...' which returns a list of
aliases rather than just file names. These aliases can be passed directly to
the open command. You don't need to futz around building new paths, etc.
Andrew
:)
On 6/21/04 5:50 AM, "BADRINATH, NANDINI" <email@hidden> wrote:
>
> Hi,
>
>
>
> i tried the following script
>
>
>
> set folderPath to "Disk:Folder:Folder:" --wherever your folder is
>
> tell application "Finder"
>
> set theFiles to (name of every file in folder folderPath) as list
>
> repeat with theFile in theFiles
>
> set filePath to folderPath & theFile
>
> open file filePath using application file id "XPR3"
>
> --do stuff in QXP?
>
> tell application "QuarkXPress"
>
> --something here to close the file;
>
> --I don't have QXP, so I don't know what it expects.
>
> --check its dictionary for a 'close' command of some kind.
>
> end tell
>
> end repeat
>
> end tell
>
> ---------------
>
> the script gives the error -- "cant make every file of " folder
>
> path" into a string"
>
>
>
> How do i declare "theFile" (in repeat) as list?
>
>
>
> regards
>
> Babith
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.