script for Quark modified images update

Hello

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:

  1. Selecting folder with all the files (set myFolder to choose folder with prompt “Choose a folder with data files:”)
  2. Then Quark opens 1 file with ‘do auto picture import yes’
  3. Then Saves file
  4. Then Closes file
  5. Then proceeds to next file and so on…

Thanks a lot in advance for any help:)

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)

Unfortunately it does not work. First strange problem… ‘use doc prefs no remap fonts no’

But Quark 7.1 asking to ‘keep project settings’ or ‘use quark preferences’ and to ‘list fonts’. Looks like this does not work at all. Any ideas?

Second AppleSript Error:

QuarkXPress Passport got an error: Can’t set auto picture import of document 1 to auto import on.

Help:/

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)

Have anyone seen below problem on 7.1?

Error:
QuarkXPress Passport got an error: An error of type 6 has occurred.

Looks like the faulty is ‘close front document saving yes’. Also ‘use doc prefs no remap fonts no’ does not work at all.

Have anyone experienced this problem?

Plus why ‘do auto picture import yes’ is needed if it does not work straight?