Re: importing images in quark
Re: importing images in quark
- Subject: Re: importing images in quark
- From: Hans Haesler <email@hidden>
- Date: Tue, 29 Oct 2002 08:25:52 +0100
On Tue, 29 Oct 2002, Peter Kincaid wrote:
>
I am trying to create a script that will take a folder of images and place
>
them into a quark doc. 1 image per page. I am new at scripting but this is
>
what I have so far.
[snip]
>
Needless to say that it doesnt work
Peter,
don't put everything inside of the Finder tell block. Using the Finder
is slow, so limit it to the strict minimum. You may even do this task
without the Finder but then you'd need to tackle it otherwise.
Why does the script not work?
1) The result of 'choose folder' is an alias. It must be coerced to a string.
2) You must get the _names_ of the EPS files.
3) You must compose the path of the image, using 'sourcefolder' and the name.
4) You must address the last page, using '-1'
---
set sourcefolder to choose folder with prompt "select folder of images" as
string
tell application "Finder"
set sourceitems to name of every item of sourcefolder whose file type is
"EPSF"
end tell
tell application "QuarkXPress 4.11"
open file "Mac4204 HD:image template"
tell document 1
repeat with newimages in sourceitems
tell page -1
make picture box at beginning with properties {bounds:{".5", ".5",
"10.5", "8"}}
tell picture box 1
set image 1 to (sourcefolder & newimages) as string
end tell
end tell
make page at end
end repeat
end tell
display dialog "Done." buttons "OK" default button 1 with icon 1
end tell
---
Hans Haesler <email@hidden>
_______________________________________________
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.