The apple script that I converted to work with OSX is giving me a funky error 32767. Some please help if you can. The script is below, that all it is to do is open a Quark Xpress 6.5 document, draw a box, delete it and then save and close it. Again if someone could help I would appreciate it greatly.
global fileName
property dfn : ""
on pathName(fileAlias)
copy fileAlias as string to xx
copy text item delimiters of AppleScript to savedDelim
set text item delimiters of AppleScript to {":"}
set fileName to last text item of xx as string
set text item delimiters of AppleScript to savedDelim
set font to Impact
end pathName
on open y
set b to button returned of (display dialog ¬
" Repair QuarkXPressâ„¢ Document
Repair existing documents or retain backups and save new documents?" buttons {"Cancel", "Repair", "Save New"} default button 3)
if b = "Save New" then
set destpath to (choose folder with prompt "Select a destination folder for new versions.") as text
end if
set x to 1
repeat number of items in y times
set docpath to item x of y
set z to info for item x of y
if z is not folder then
if z's file type is not "XPRJ" then
beep 2
else
tell application "QuarkXPress"
open item x of y use doc prefs yes
tell document 1
make text box at beginning
tell text box 1
set name to "GlenBox"
set bounds to {"3 pt", "3 pt", "13 pt", "13 pt"}
end tell
delete text box "GlenBox"
if b = "Save New" then
my pathName(docpath)
try
save in (destpath & fileName)
on error number -47
if dfn = "Replace" then
save
else
set dfn to button returned of (display dialog "The original file(s) currently exist(s) in this location. Do you want to replace the original document(s)?" buttons {"Replace", "Cancel"} default button 2 with icon caution)
if dfn = "Replace" then save
end if
end try
close
else if b = "Repair" then
save
close
end if
end tell
end tell
end if
set x to x + 1
else
beep 1
end if
end repeat
with timeout of 600000 seconds
tell application "QuarkXPress"
activate
display dialog "Rock On!" & return & return & "Your Documents Have Been Repaired"
end tell
end timeout
end open