Wednesday, December 12, 2018

#1 2006-04-27 12:58:33 pm

oduran
Member
Registered: 2006-04-25
Posts: 4

Bounds of box in Quark

I am trying to work with the bounds of my picture but there are in type I don't recognize. I want them as real.

Can someone help me ?

Applescript:


set NewBox to make new graphic box at beginning with properties {bounds:({110, 0, 220, 46}), contents:none, color:null, frame:{color:"noir", style:solid, width:"1 pt"}, runaround:none runaround}
           
set box shape of NewBox to polygonal
set c to height of bounds of NewBox
set d to width of bounds of NewBox
set a to top of bounds of NewBox
set b to left of bounds of NewBox
           
return {a, b, c, d}
--results: {«data FXVM0137CF7A», «data FXHM00000000», «data FXVM0137CF7A», «data FXHM008264BA»}

Offline

 

#2 2006-04-27 08:32:14 pm

Jerome
Member
From:: Ohio
Registered: 2003-06-14
Posts: 709
Website

Re: Bounds of box in Quark

I dont have Quark at home to test, and without the whole script with tell statements I can't acuratly evaluate what is going on. My guess is that your return is outside of the Quark tell statement. Since the values returned from Quark for the bounds are Quark measurements the return doesnt know how to deal with the value set from Quark. You need to add "as real" to the end of your set statements for the variables a b c and d this way Quark will coerce the values into real numbers which can be used outside of the Quark tell block.

Offline

 

#3 2006-05-04 07:56:30 am

Kjeld
Member
From:: Amsterdam
Registered: 2003-11-08
Posts: 142
Website

Re: Bounds of box in Quark

try something like this:

Applescript:

                       --Get bounds of box
                       set obnds to bounds as list
                       set boxtp to (coerce item 1 of obnds as millimeter units to real)
                       set boxlft to (coerce item 2 of obnds as millimeter units to real)
                       set boxbot to (coerce item 3 of obnds as millimeter units to real)
                       set boxri to (coerce item 4 of obnds as millimeter units to real)

kjeld

Offline

 

#4 2008-06-25 10:51:21 am

sprale
Member
From:: Texas
Registered: 2007-06-07
Posts: 131

Re: Bounds of box in Quark

I am writing a script to change the width of any text box that is more than 15p wide to 42p. I have almost everything I need working, except setting the width to a variable that is readable.

Applescript:

set FileSample to choose folder
set folderName to name of (info for FileSample)
tell application "Finder" to set theFiles to files of folder FileSample whose name extension is in {"qxd"} or kind contains "QuarkXPress" or file type is in {"XPRJ", "XPR3"} or creator type is in {"XPRJ", "XPR3"}
repeat with oneFile in theFiles
   tell application "QuarkXPress"
       activate
       open (oneFile as alias) do auto picture import no use doc prefs yes remap fonts no
       tell front document
           set page rule origin to {"0", "0"}
           set horizontal measure to picas
           set vertical measure to picas
           repeat with i from (count of group boxes) to 1
               try
                   tell group box i
                       set grouped to false
                   end tell
               end try
           end repeat
           repeat with i from 1 to count of text boxes
               set boxWidth to ((get width of bounds of text box i) as real) as string --Errors here
               if boxWidth is less than 15 then
                   tell text box i
                       (select)
                       set width of bounds to {42}
                   end tell
               end if
           end repeat
       end tell
       close saving yes
   end tell
end repeat

The problem is I get this error:

Can't make «data FXHM01680000» into type real.



Model: Dual 2.3GHz G5
AppleScript: 2.1.1/Script Debugger4
Browser: Firefox 3.0
Operating System: Mac OS X (10.5)


Dead-thread Necromancer!

Offline

 

#5 2012-05-27 10:08:32 pm

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

Did you ever solve this problem?  I'm experiencing it with a project upgrading from Quark 7 to Quark 9.  Suddenly the data coming from bounds won't convert into real.

tell application "QuarkXpress"
return bottom of the bounds of text box 1 of document 1 as real
end
-- result = can't make «data FXVM00002400» into type real

Offline

 

#6 2012-05-28 05:41:15 am

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2808
Website

Re: Bounds of box in Quark

Did you loaded the QXPScriptingAddition? Seems like the scripting addition that is needed for Quark isn't loaded properly.

Offline

 

#7 2012-05-28 09:51:59 am

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

DJ Bazzie Wazzie wrote:

Did you loaded the QXPScriptingAddition? Seems like the scripting addition that is needed for Quark isn't loaded properly.


Does this need to be done explicitly by the script?  Is that a change in QXP 9?  The app has a scripting dictionary, which past experience tells me means it has it's stuff installed correctly.  Perhaps not........?

Offline

 

#8 2012-05-28 04:53:00 pm

DJ Bazzie Wazzie
Member
From:: the Netherlands
Registered: 2004-10-20
Posts: 2808
Website

Re: Bounds of box in Quark

Normally it is installed but it can be the wrong version. It coerces the data objects from Quark into AppleScript objects. The file can be found in the '/Library/Scripting Additions' folder. Without the addition installed you will get those weird errors.

Offline

 

#9 2012-05-28 06:26:15 pm

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

DJ Bazzie Wazzie wrote:

Normally it is installed but it can be the wrong version. It coerces the data objects from Quark into AppleScript objects. The file can be found in the '/Library/Scripting Additions' folder. Without the addition installed you will get those weird errors.


It is installed but it says QXPScriptingAdditions 7.0.  Should that be 9.0 to match the app version or not?

Offline

 

#10 2012-05-29 02:28:36 am

Hans-Gerd Classen
Member
From:: Aachen, Germany
Registered: 2010-02-19
Posts: 192

Re: Bounds of box in Quark

Mark Munro wrote:

It is installed but it says QXPScriptingAdditions 7.0.  Should that be 9.0 to match the app version or not?


I'm not sure of this is parralel versioning ...

But you may try to run ASE in 32-Bit-Mode. I don't have quark installed at the moment, but have something like this in mind ... perhaps it'll help.


Hans
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
AppleScript amateur with just basically english skills – so please be patient … ;-)

Offline

 

#11 2012-05-29 08:08:40 am

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

Hans-Gerd Classen wrote:

But you may try to run ASE in 32-Bit-Mode. I don't have quark installed at the moment, but have something like this in mind ... perhaps it'll help.


No help with 32 bit mode...

Offline

 

#12 2012-05-29 08:13:25 am

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

I also note that on a 10.5 running Quark 7, the scripting addition version is 7.  I don't know if that means the 9.0 machine has the wrong version or they haven't changed it...?  Anyone know this?

Offline

 

#13 2012-05-29 09:04:36 am

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

Applescript:

tell application "QuarkXPress"
   tell document 1
       tell page 1
           tell text box 1
               return top of bounds as point units as real -- From Quark sample script!
               -- error "Can’t make «data FXVM00005400» into type point units." number -1700 from «data FXVM00005400» to «class FXPT»
               return top of bounds as real
               -- error "Can’t make «data FXVM00005400» into type real." number -1700 from «data FXVM00005400» to real
               return top of bounds as number
               -- error "Can’t make «data FXVM00005400» into type number." number -1700 from «data FXVM00005400» to number
           end tell
       end tell
   end tell
end tell

Offline

 

#14 2012-05-29 09:24:19 am

sprale
Member
From:: Texas
Registered: 2007-06-07
Posts: 131

Re: Bounds of box in Quark

Funny this thread should light up again, since I've been having the issue again. I actually removed the QXPScriptingAdditions.osax from the Library/ScriptingAdditions folder. I'm using Quark 8, but simply disabling it resolved this issue for me, though the ScriptingAddition was 7.0. The script compiles and runs without issue now. Go figure. roll

Model: MBP
AppleScript: 2.3
Browser: Firefox 12.0
Operating System: Mac OS X (10.5)


Dead-thread Necromancer!

Offline

 

#15 2012-05-29 09:58:57 am

Mark Munro
Member
Registered: 2008-01-16
Posts: 175
Website

Re: Bounds of box in Quark

sprale wrote:

Funny this thread should light up again, since I've been having the issue again. I actually removed the QXPScriptingAdditions.osax from the Library/ScriptingAdditions folder. I'm using Quark 8, but simply disabling it resolved this issue for me, though the ScriptingAddition was 7.0. The script compiles and runs without issue now.)


I just tried removing it and testing and the problem still exists...  I also restarted the computer.  Same error...  :-(

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)