I’m trying to run a script in Quark Xpress 7.5. It works on everyone else’s computer, but not mine. If I log out and log back in as a new user on the same computer, it DOES work. I have trashed preferences, repaired permissions, and tested computers with the exact same versions of all programs that I have.
What else can I try? There has to be a buggy file somewhere!
Thanks for any advice,
Dan
Model: Power Mac G5
AppleScript: 2.1.2
Browser: Safari 525.27.1
Operating System: Mac OS X (10.4)
I figured this might be a common problem and someone could just tell me to “delete the file Quark_pref_script.ext.” or something like that. Script is below.
tell application "QuarkXPress"
try
set xDoc to (properties of document 1)
on error -- must not be a document open
ignoring application responses
display alert ("Please open a Quark Doc first!") buttons {"Stop"} default button 1
return
end ignoring
end try
set xPath to my PathFix(file path of xDoc as string)
set xDocName to (name of xDoc as string)
tell document 1
set oldISC to item spread coords
set oldSRO to spread rule origin
set oldH to horizontal measure
set oldV to vertical measure
set item spread coords to true
set spread rule origin to {0, 0}
set horizontal measure to points
set vertical measure to points
set xUsage to (modified of every image)
if xUsage contains true then -- pictures are not updated
display alert ("Please update/fix all linked files first!") buttons {"Stop"} default button 1
return
end if
set xBoxes to (properties of every picture box where ((file type of image 1 = TIFF picture) or (file type of image 1 = JPEG picture))) as list
set xNum to 1
repeat with x in xBoxes
set myBox to (properties of object reference of x) --get picture box specs
set myHflip to (flipped horizontal of myBox)
set myVflip to (flipped vertical of myBox)
set myRot to (angle of image 1 of object reference of x)
set (angle of image 1 of object reference of x) to "0°"
set flipped horizontal of (object reference of x) to false
set flipped vertical of (object reference of x) to false
set myBox to (properties of object reference of x) --get picture box specs after flipped
set myImage to (properties of image 1 of object reference of myBox) -- get it's image specs
--get the scaling information
set xScale to (contents of scale of myImage)
tell image 1 of object reference of myBox
set xScale to (get scale as list)
end tell
--build the record info to send to Photoshop
set mySpecs to {iPath:"", iScale:{}} --get the specifics of the image: path, scaling
copy (file path of myImage as string) to iPath of mySpecs
copy (coerce item 2 of xScale to number) to end of iScale of mySpecs
copy (coerce item 1 of xScale to number) to end of iScale of mySpecs
set myNewPath to (my psSizing(mySpecs, xPath, xNum))
if myNewPath = "errorFound" then
display dialog ("Photoshop Error!!") buttons {"Bummer"} default button 1
return
end if
set file path of myImage to (contents of myNewPath) as alias
activate
tell (object reference of x)
set image 1 to (file path of myImage)
tell image 1
set scale to {"100%", "100%"}
set shade to (shade of myImage)
set skew to (skew of myImage)
set opacity to (opacity of myImage)
set offset to (offset of myImage)
set suppress printing to (suppress printing of myImage)
set angle to myRot
end tell
set flipped horizontal to myHflip
set flipped vertical to myVflip
end tell
do updates
set xNum to (xNum + 1)
end repeat
-- reset the measurements to the way they were
set item spread coords to oldISC
set spread rule origin to oldSRO
set horizontal measure to oldH
set vertical measure to oldV
end tell
ignoring application responses
display dialog ("Images have been re-sized to 100%") buttons {"Done"} default button 1
end ignoring
end tell
on volumeCheck() --mount the Layout volume
set xDrives to {}
tell application "Finder"
set xDrives to list disks
if not (xDrives contains "Layout") then mount volume "afp://ICS-Xserve.local/Layout" as user name "macuser" with password "macuser"
end tell
end volumeCheck
on PathFix(docName)
set AppleScript's text item delimiters to ":"
set xRemove to (the last text item of docName)
set AppleScript's text item delimiters to ""
return (text from character 1 to character ((length of docName) - (length of xRemove)) of docName)
end PathFix
on getName(imagePath)
set AppleScript's text item delimiters to ":"
set fName to (the last text item of imagePath)
set AppleScript's text item delimiters to ""
return fName
end getName
on psSizing(thisImage, xPath, xNum)
tell application "Adobe Photoshop CS3"
activate
open file (contents of iPath of thisImage) showing dialogs never
if mode of current document = "RGB" then
return errorFound
end if
if mode of current document = bitmap then
set xRes to 601.0
else
set xRes to 300.0
end if
set xName to (my nameFix(name of current document, xNum)) -- fix name of file
set xW to ((width of current document as inches) * xRes) as integer
set xH to ((height of current document as inches) * xRes) as integer
if (((item 1 of iScale of thisImage) < 1) or ((item 2 of iScale of thisImage) < 1)) then
set xMethod to bicubic smoother
else
set xMethod to bicubic sharper
end if
resize image current document ¬
width ((xW * (item 1 of iScale of thisImage)) as integer) as pixels ¬
height ((xH * (item 2 of iScale of thisImage)) as integer) as pixels ¬
resolution xRes resample method xMethod
set mySave to (contents of xPath as string) & (contents of xName as string)
save current document as TIFF in mySave
close current document
return (mySave)
end tell
end psSizing
on nameFix(xName, xNum) --fix the image name by adding the "loop count"
if xName ends with ".tif" then -- remove extension & add loop count
set xName to (text from character 1 of xName to character ((length of xName) - 4) of xName)
end if
if xName ends with ".tiff" then -- remove extension & add loop count
set xName to (text from character 1 of xName to character ((length of xName) - 5) of xName)
end if
if xName ends with ".jpg" then -- remove extension & add loop count
set xName to (text from character 1 of xName to character ((length of xName) - 4) of xName)
end if
if xName ends with ".jpeg" then -- remove extension & add loop count
set xName to (text from character 1 of xName to character ((length of xName) - 5) of xName)
end if
return (xName & "_" & xNum & ".tif")
end nameFix
No, there isn’t.
Maybe you could give more information.
Doesn’t work means:
it doesn’t compile?
it compiles but works not at all ?
it launches and freezes ?
it generates an error ? if yes in which line?
etc.
Do you have any additional Scripting Additions installed on one machine but not on the other?
It’s a mystery. I did an archive install of the os, and reinstalled all my programs, and still it doesn’t run. When I say it doesn’t run, it’s just that. I click the little script icon in quark, I choose the script, and nothing. It’s as if I never clicked it at all. Absolutely nothing happens. It doesn’t freeze, it doesn’t open any applications, it doesn’t give an error, it doesn’t even indicate that I clicked or selected anything. It works on my machine if I log out and log back in as a different user, but not with my main user.
The first thing that is supposed to happen is that PhotoShop should launch or come to the front of the screen. It doesn’t.
Try commenting the whole script out, by putting a (* at the beginning of the script and a *) at the end.
Then add one line- like
beep 3
or
display dialog “Hello”
and then try to run the script. That will tell you if the problem is with the script itself (which seems unlikely) or with getting the script to run. (If you use the beep 3 line, make sure your sound is on.)
error “Can’t make «data fss 9CFFFC880A000933572D33582E717870009A57010000000000000000833F259818E6FFBFA8931400F8E5FFBF04E6FFBF000000009D233097F0572A2E22750F0060C9362E2C2E» into type string.” number -1700 from «data fss 9CFFFC880A000933572D33582E717870009A57010000000000000000833F259818E6FFBFA8931400F8E5FFBF04E6FFBF000000009D233097F0572A2E22750F0060C9362E2C2E» to string
Since it will start with you logged in as another user, I’d suggest that you download Onyx or some other free cache cleaning utility and clean everything except your logs and your browser history.
After that boot once into safe mode and wait a 10-15 seconds before doing anything.
By the way, have you compared your log files with the one from your new user account.
You should throw out any osax that shows up with an error message in the system.log file
as StefanK touched in the post above.