Hi,
I have made this following script, with great help from the Dutch MacOSX forum and this forum.
For me the script works fine (Quark 5, AppleScript 1.7, OS 9.2)
Now I wanted to ask the people here, who are willing to, to test this script on their system.
I want to make the script work for Quark 6.
I don’t have Quark 6 myself, so I can’t test it myself or change the script to make it work for Quark 6.
This is the script:
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
quickSort(picList, 1, count of picList)
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
on quickSort(A, L, R)
script
property aList : A
end script
tell result
set ctr to L
set n to R
set aRef to item L of its aList
repeat while ctr < n
repeat while (aRef < item n of its aList) and (ctr < n)
set n to n - 1
end repeat
if n is not ctr then
set item ctr of its aList to item n of its aList
set ctr to ctr + 1
end if
repeat while (aRef > item ctr of its aList) and (ctr < n)
set ctr to ctr + 1
end repeat
if n is not ctr then
set item n of its aList to item ctr of its aList
set n to n - 1
end if
end repeat
set item n of its aList to aRef
if L < n then
quickSort(its aList, L, n - 1)
end if
if R > ctr then
quickSort(its aList, ctr + 1, R)
end if
return its aList
end tell
end quickSort
tell application "QuarkXPress Passport™"
activate
set docname to name of document 1
tell document docname
repeat with userChoice in picList
set selection to null
try
set theList to picList
set userChoice to (choose from list theList with prompt "make a choice" without multiple selections allowed)
end try
set the clipboard to contents of userChoice as string
repeat while selection is null
end repeat
try
set image 1 of current box to file ((picFolder as text) & userChoice)
set offset of image 1 of current box to {"-4,071 mm", "-5,42 mm"}
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
This is how the script should work:
Make sure, before you run the script, that you have a new document ready with several picture boxes in it.
When you run the script:
- you will be asked to select a folder with images. Make sure that, when you select a folder, the folder only contains images.
- Now a list will appear with all the images in it, listed on alphabetical order. Select an item from the list and press “Ok”.
- Now select a picture box in your new document.
- After clicking on the picture box the selected item will be imported in the picture box.
- After importing the list will show up again.
When you want to quit the script, click the “Annuleer” button when the list appears. Annuleer is Dutch for Cancel :).
An error will show up. Click the “Stop” button. Quark now asks you if you want to save the changes in your new document. Click the “Annuleer” or “Cancel” button.
This is how the script works for me with Quark 5.
For the people who are going to test this script, can you please mention, besides the error message:
- Which QuarkXpress version you use
- Which AppleScript version you use
- Which OS you use
In advance, thanks!
Frederick