Can someone help me with simple script for Quark. Would be great it could work both on 7.1 (OS X) and 4.11 (OS 9).
I have 400 files with modified images and would like Quark to update them automatically. I know there is ‘do auto picture import yes’ and it should update all images on opening file (in Quark: Auto Picture Import)
So sequence should be:
Selecting folder with all the files (set myFolder to choose folder with prompt “Choose a folder with data files:”)
Then Quark opens 1 file with ‘do auto picture import yes’
Below is the code but Quark does not update modified images. Can someone help? Any ideas why it does not work?
Code:
set the_container to choose folder with prompt “Pick the folder you want to work through”
resave_quark_files(the_container)
to resave_quark_files(the_container)
tell application “Finder”
set document_file_list to files of container the_container
repeat with the_file in document_file_list
if file type of the_file = “XPRJ” then
tell application “QuarkXPress Passport”
open the_file use doc prefs yes remap fonts no do auto picture import yes
close front document saving yes
end tell
end if
end repeat
set container_list to (folders of container the_container)
end tell
repeat with the_sub_container in container_list
set the_sub_container to (the_sub_container as string) as alias
my resave_quark_files(the_sub_container)
end repeat
end resave_quark_files
I continue to be baffled by the “do auto picture import yes” part of open. If you have the preference of your file set to auto picture inport “No”, this command in AppleScript doesn’t do anything. If your preference is set to “Yes”, the file will update on its own without doing anyting with AppleScript. I just tested what happens if auto pic import preference in the file is set to “Verify” and even if AppleScript says imrt “Yes”, it still brings up a dialog box asking you to verify. There doesn’t appear to be any use for this command. If anyone has any more information, please post.
Anyway, I experimented and I think the only way to achieve what you want is to open each file, turn the auto picture import preference for the document to “Yes”, close and save, and then open it again so it up automatically update the modified links. Here is your script with those additional steps added. I am in Quark 6.5 so hopefully this will work in 7. I have no idea if it would work in 4.
I tested it briefly - you might want to check it out on a couple of files before running it on all 400…
set the_container to choose folder with prompt "Pick the folder you want to work through"
resave_quark_files(the_container)
to resave_quark_files(the_container)
tell application "Finder"
set document_file_list to files of container the_container
repeat with the_file in document_file_list
if file type of the_file = "XPRJ" then
tell application "QuarkXPress Passport"
open the_file use doc prefs yes remap fonts no do auto picture import yes
tell front document to set auto picture import to auto import on
close front document saving yes
open the_file use doc prefs yes remap fonts no do auto picture import yes
close front document saving yes
end tell
end if
end repeat
set container_list to (folders of container the_container)
end tell
repeat with the_sub_container in container_list
set the_sub_container to (the_sub_container as string) as alias
my resave_quark_files(the_sub_container)
end repeat
end resave_quark_files
Model: G5 Tower (not Intel) - Script Editor ver 2.1.1
AppleScript: Tiger
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
I didn’t make any change to the open line. Were you having this problem before? It may be an issue with 7 and I am still in 6.5. Any 7 users out there with advice…
As far as the second problem, it sounds like 7 addresses the preferences differently. Try experimenting with telling the layout space. Something like:
tell front document to set auto picture import of layout space 1 to auto import on
Again, I am in 6.5 so I can’t test to see which syntax will work.
Model: G5 Tower (not Intel) - Script Editor ver 2.1.1
AppleScript: Tiger
Browser: Safari 419.3
Operating System: Mac OS X (10.4)