RE: Quark issue with grouped box & bounds
RE: Quark issue with grouped box & bounds
- Subject: RE: Quark issue with grouped box & bounds
- From: "Nick Hearn" <email@hidden>
- Date: Fri, 11 May 2007 14:06:04 +0100
- Thread-topic: Quark issue with grouped box & bounds
***Before acting on this email or opening any attachment you are advised to read the disclaimer at the end of this email***
************************************
Hi JJ,
Not had chance to look at this properly but I've managed to replicate the problem in 6.52, complete with crash.
I'm not sure if the information below might be of any use, it's from a post by Hans Haesler regarding grouped boxes.
Regards
Nick
=====================================================
Jan,
this snippet addresses group 1 of the main group:
---
tell document 1 of application "QuarkXPress 6.52"
tell group box 1
tell group box 1
count of picture boxes
end tell
end tell
end tell
---
When you've got a selection, but you don't know if
it contains any groups then this should work:
---
set nPicBox to 0
tell document 1 of application "QuarkXPress 6.52"
tell selection
tell every group box
set nPicBox to count of picture boxes
end tell
end tell
if nPicBox is 0 then
set nPicBox to count (every picture box whose selected is true)
end if
end tell
nPicBox
---
Regards,
Hans
==============================================================
-----Original Message-----
From: applescript-users-bounces+nick.hearn=email@hidden [mailto:applescript-users-bounces+nick.hearn=email@hidden] On Behalf Of jj
Sent: 11 May 2007 13:06
To: applescriptmaillist
Subject: Quark issue with grouped box & bounds
Hi all!
I have the following stage: two grouped text boxes in a page, both containing text.
I want to pick the text of one of them and place it in a new-created text box I will place over the original one (a bit shorter than the original one), something as (ascii-art):
Original:
----------------------
| |
| |
| TEXT |
| |
| |
----------------------
Target:
----------------------
| |
| -------------- |
| | TEXT | |
| -------------- |
| |
----------------------
This is the code:
#################
tell application "QuarkXPress Passport" --> vers 7.1
--> pick text
set original to text box 1 of page 1 of document 1
set selection to (get object reference of text of original)
cut
--> pick and modify bounds
copy bounds of original to bnds
set {y1, x1, y2, x2} to (coerce bnds to list)
set x1 to coerce x1 to real
set x2 to coerce x2 to real
set y1 to coerce y1 to real
set y2 to coerce y2 to real
set x1 to x1 + 2.469
set x2 to x2 - 2.469
set y1 to y1 + 2.469
set y2 to y2 - 2.469
--> apply both bounds and text to new text box
set newBoxBnds to {y1, x1, y2, x2} as millimeters rectangle
set ntb to (make new text box at beginning of page 1 ¬
of document 1 with properties {color:null})
set selection to ntb
set tool mode of document 1 to contents mode
paste
set bounds of ntb to newBoxBnds
end tell
#################
This works fine. HOWEVER, when I pick the boxes and move them somewhere around, the boxes don't move as they should. The original text box moves to a different place. Also, if I cut all the three boxes, Quark just crashes.
No problem if the original text box is not part of a group.
What is happening or how to fix, or do you have a working alternate for this simple task?
Thanks in advance!
jj
--
http://www.macscripter.net/
http://www.osaxen.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
**********************************************************************
Communisis plc - registered no: 2916113 is a limited company registered in England and Wales and whose registered office is at Wakefield Road, Leeds, LS10 1DU.
Please Note: This e mail and its attachments contain only the opinions of the sender and do not necessarily reflect the policy (s) of the Communisis group in general.
Confidentiality: This e-mail and the contents of any attachments are intended for the named recipient(s) only and may be confidential. If you have received this e-mail and its contents in error you must take no action based on them, nor must you copy or show them to anyone. Please reply to this e-mail and highlight the error.
Warning: Although this e-mail and any attachments have been scanned for viruses, Communisis cannot guarantee that they are virus free. The Communisis group therefore accepts no responsibility for any loss or damage caused by transmission of this e-mail.
**********************************************************************
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden