Author Topic: Script not working in Quark 2017  (Read 31 times)

0 Members and 1 Guest are viewing this topic.

Offline Star123

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Script not working in Quark 2017
« on: May 10, 2019, 08:27:03 AM »
Hi Jean-Marie,

My system has been upgraded from
OS X Yosemite - Version 10.10.5, Quark Xpress 9.5 and Script Editor 2.5
to
Mac OS Sierra - Version 10.12.6, Quark Xpress 2017 and Script Editor 2.5

Below (Your) Script which works fine in Quark 9.5 and not working in Quark 2017

Showing Coercing Error

Code: [Select]
tell application "QuarkXPress"
activate
tell document 1
set horizontal measure to picas
set vertical measure to picas

set theSelection to selection
set values to {horizontal offset of theSelection}
set values1 to {width of theSelection}
set values to coerce values to real
set values1 to coerce values1 to real

get bounds of current box
set y1 to coerce (item 1 of (bounds of current box as list)) to real
set x1 to coerce (item 2 of (bounds of current box as list)) to real
set y2 to coerce (item 3 of (bounds of current box as list)) to real
set x2 to coerce (item 4 of (bounds of current box as list)) to real

set boundsList to {y1, x1, y2, x2}
try
tell current page
set values to values + x1
make vertical guide at beginning with properties {position:values}
set values1 to values1 + values
make vertical guide at beginning with properties {position:values1}
end tell
end try
end tell
end tell


Throws the below error.


Code: [Select]
tell application "QuarkXPress 2017"
activate
set horizontal measure of document 1 to picas
set vertical measure of document 1 to picas
get selection of document 1
--> text from character 460 to character 465 of text flow 1 of text box 1 of document "Project1.qxp"
get horizontal offset of text from character 460 to character 465 of story 1 of text box 1 of document "Project1.qxp"
--> "4p4.687"
get width of text from character 460 to character 465 of story 1 of text box 1 of document "Project1.qxp"
--> "2p6.012"
coerce {"4p4.687"} to real
--> error number -1700
Result:
error "QuarkXPress 2017 got an error: Can’t make some data into the expected type." number -1700 to item

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: 6
  • Gender: Male
Re: Script not working in Quark 2017
« Reply #1 on: May 13, 2019, 02:54:49 AM »
Hi there! I'm sorry for that! It's one the reasons why I stay on Yosemite and Quark 9.5 actually. (I mean not necessarily this one script, but such bugs or undesired behaviors due to upgrades).
Though I own a copy of Q2017, I won't be able to check that in the next few days. Sorry. Coercion is a nightmare (at least for me) accross the last versions of MacOS.
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline Star123

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Script not working in Quark 2017
« Reply #2 on: May 13, 2019, 08:25:10 PM »
OK Thanks