try
tell application "Finder" to set the picFolder to (choose folder with prompt "Selecteer een map met afbeeldingen") as alias
try
set picList to list folder picFolder without invisibles
on error
display dialog "Error! could not set piclist to list folder" buttons {"Exit"} default button 1 with icon stop
return
end try
on error
display dialog "Error! could not set alias for chosen folder" buttons {"Exit"} default button 1 with icon stop
return
end try
tell application "QuarkXPress Passport™"
activate
set docname to name of document 1
tell document docname
set view scale to fit page in window
repeat with ThisItem in ItemList
set selection to null
set ItemText to "Please locate the container for the following item:" & return & return & ThisItem
display dialog ItemText with icon note giving up after 1
try
tell application "QuarkXPress Passport™" to repeat while current box is null
delay 2
end repeat
if box type of current box is picture box type then
set image 1 of current box to file (SourceFolder & ThisItem)
else if box type of current box is text box type then
set story 1 of current box to file (SourceFolder & ThisItem)
end if
end try
end repeat
end tell
beep 3
end tell
what it should do is:
ask to select a folder with images
ask to select a picture box
import the image in the selected picture box and continue untill all images are imported
but it’won’t work.
What is wrong with this script?
I changed a few things in the script, and added your part to it
this is how the script works for me:
try
tell application "Finder" to set the picFolder to (choose folder with prompt "Select a folder with images") as alias
try
set picList to list folder picFolder without invisibles
on error
display dialog "Error! could not set piclist to list folder" buttons {"Exit"} default button 1 with icon stop
return
end try
on error
display dialog "Error! could not set alias for chosen folder" buttons {"Exit"} default button 1 with icon stop
return
end try
tell application "QuarkXPress Passport™"
activate
set docname to name of document 1
tell document docname
set view scale to fit page in window
repeat with ThisItem in picList
set selection to null
set ItemText to "Selecteer een kader voor het volgende item:" & return & return & ThisItem
display dialog ItemText with icon note
repeat while selection is null
end repeat
try
set image 1 of current box to file ((picFolder & ThisItem) as string)
set selection to null
on error
display dialog "Het geslecteerde kader is geen illustratiekader" buttons {"Stop"} default button 1 with icon stop
quit script
end try
end repeat
end tell
beep 3
end tell
As you see I’m working with Passport
but can you check if this will also work with Quark 6?
thanks