Recent Posts

Pages: [1] 2 3 4 5 ... 10
1
Quark XPress scripting / Re: Script not working in Quark 2017
« Last post by Star123 on May 13, 2019, 08:25:10 PM »
OK Thanks
2
Quark XPress scripting / Re: Script not working in Quark 2017
« Last post by Jean-Marie Schwartz 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.
3
Quark XPress scripting / Script not working in Quark 2017
« Last post by Star123 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
4
Scripting in general / Re: Renaming and Filing Images
« Last post by FredrickB on April 16, 2019, 06:56:04 AM »
Is there a limit on how many images you can rename with this code?
5
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Jean-Marie Schwartz on April 15, 2019, 02:33:36 AM »
Lucky you  ;D Thanks be to Michel who taught me a lot!  ;) Glad the script meets your expectations and more! Enjoy!
6
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Star123 on April 11, 2019, 04:36:54 PM »
Hi Jean-Marie Schwartz,

Thank You Soooooooooo Much..............

Your Script is Awesome. It works more than my expectation.

Every time I came to this Forum. You saved me a day. But this time, You saved me a month. Because this task will be a great challenge to me while TyeSetting.

One Again Thank You So Much,
John
7
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Jean-Marie Schwartz on April 11, 2019, 11:12:04 AM »
Hi John,

Trying to understand better what you want.

So on one side, you have a text file with some paragraphs. Is the number of paragraphs directly related to the number of columns in the Quark file? (I can see 24 paras for 6 columns…)
Are those paragraphs strictly set? I mean do they have the same length all the time for a given column? Or is the length variable from one paragraph to another?

On the other side, in the Quark file, from file to file there would be 2 to 6 columns, right? So the file the user is running the script on might show up 2, 3, 4, 5 or 6 columns, is that right? And the columns always have variable dimensions from file to file and from column to column, right? Are the boxes always positioned at the same Y coordinates (vertical measures) from file to file?

Are all the text boxes embedded (inline)? And do they need to remain inline? Is the box height correctly set to welcome the data? Or does the script need to adaptate the height according to the paragraph length?



Anyway, here is a first try on Testing2.qxp that I sent you by email. (line 1 and 2 kept alone, line 2 contains the inline text boxes). The following script is taking the number of paragraphs of Data File (the text that is in the Clipboard) into account and duplicating line 2 as many times as needed (so if there are 30 paras and 6 columns, it'll add 4 more lines after line 2 so there'll be 5 lines of 6 columns). Then the script will populate all the inline text boxes with the text as asked.

Please let me know if anything is going wrong. And note that I'll be off till Monday.


Code: [Select]
(* 

SELECT THE PARAGRAPHS HERE BELOW PRIOR TO RUN THIS SCRIPT !!!

Paragraph 1 from Data File
Paragraph 2 from Data File
Paragraph 3 from Data File
Paragraph 4 from Data File
Paragraph 5 from Data File
Paragraph 6 from Data File
Paragraph 7 from Data File
Paragraph 8 from Data File
Paragraph 9 from Data File
Paragraph 10 from Data File
Paragraph 11 from Data File
Paragraph 12 from Data File
Paragraph 13 from Data File
Paragraph 14 from Data File
Paragraph 15 from Data File
Paragraph 16 from Data File
Paragraph 17 from Data File
Paragraph 18 from Data File
Paragraph 19 from Data File
Paragraph 20 from Data File
Paragraph 21 from Data File
Paragraph 22 from Data File
Paragraph 23 from Data File
Paragraph 24 from Data File
Paragraph 25 from Data File
Paragraph 26 from Data File
Paragraph 27 from Data File
Paragraph 28 from Data File
Paragraph 29 from Data File
Paragraph 30 from Data File



*)

set the_data to every text of (the clipboard)
set the_text to every paragraph of the_data
--set the_count to length of the_text
repeat while ((item -1 of the_text) is "")
set the_text to (reverse of (rest of (reverse of the_text)))
end repeat
set NOP to length of the_text -- number of paragraphs in Data File

tell application "QuarkXPress9"
tell document 1
set my_list to {}
set props to properties of every text box
repeat with a_box in props
if anchored of a_box is true then
set end of my_list to a_box
end if
end repeat
set NOC to length of my_list -- number of "cells" in line 2
try
if NOP > NOC then
set repeat_line_2 to NOP div NOC
repeat (repeat_line_2 - 1) times
tell story 1 of current box
copy line 2 to after line -1
end tell
end repeat
end if
end try
set my_list to {}
set props to properties of every text box
repeat with a_box in props
if anchored of a_box is true then
set end of my_list to a_box
end if
end repeat
set my_list to reverse of my_list
repeat with j from 1 to length of my_list
try
set story 1 of object reference of item j of my_list to item 1 of the_text
set the_text to rest of the_text
end try
end repeat
end tell
end tell

beep 2
8
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Jean-Marie Schwartz on April 11, 2019, 03:26:29 AM »
Great! Found it in the Spams… Saved it ;-) I'll be back as soon as I can.
9
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Star123 on April 10, 2019, 12:10:57 PM »
I have resend it
10
Quark XPress scripting / Re: Bounds of multiple Boxes
« Last post by Jean-Marie Schwartz on April 10, 2019, 07:52:02 AM »
Sorry, I have got nothing. Maybe trashed with Spams? Can you try one more time please?
Pages: [1] 2 3 4 5 ... 10