Quark bug?: insertion point + set contents of selection
Quark bug?: insertion point + set contents of selection
- Subject: Quark bug?: insertion point + set contents of selection
- From: jj <email@hidden>
- Date: Sun, 03 Dec 2006 19:34:47 +0100
- Thread-topic: Quark bug?: insertion point + set contents of selection
Hi all!
Still trying to insert the damn bullets where I like them in my fashion
paragraphs...
I've been trying workingaround the issue explained in my previous post using
offsets and so on, but now I've encountered this new problem:
###################
set selection to insertion point after character x of story 1 of current box
--> OK, I can see the cursor in the related location
set contents of selection to ""
--> NO!!!
###################
The bullet is inserted in a different place (some characters after the
mentioned insertion point).
So, help, please. All I wish is the following. I have a text:
###################
Male names:
Richard
Gregory
###################
Now, I will select manually Richard and Gregory and run the script, which
will automagically convert the text to:
###################
Male names:
Richard
Gregory
###################
That's all. No sounds & whistles.
I've observed that my code works pretty fine for text in the very beginning
of a text box, but not if I have lots of text before the selected one. (*)
Note: I'd better not use the clipboard, as I have formatted text.
This is the code:
##################
tell application "QuarkXPress Passport"
set s to object reference of selection
set k1 to (offset of s) - 1
set k2 to k1 + (length of s)
set pars to offset of (paragraphs of s whose offset > k1 and offset <
k2)
--> añadir boliches
repeat with i from 1 to count pars
set inp to (pars's item i) + ((i - 1) * 2)
set selection to ¬
insertion point after character inp of story 1 of current box
-- uncomment the following to *see* if the insertion point is OK
-- delay 2
set contents of selection to "" & tab
end repeat
end tell
##################
Cheers!
jj
(*) I think the deviation is due to the number of previous anchored boxes in
the related story (ie, deviation of 2 characters every anchored box?).
--
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)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden