Re: Quark bug?: insertion point + set contents of selection
Re: Quark bug?: insertion point + set contents of selection
- Subject: Re: Quark bug?: insertion point + set contents of selection
- From: Michael Slomski <email@hidden>
- Date: Sun, 03 Dec 2006 21:17:09 +0100
- Thread-topic: Quark bug?: insertion point + set contents of selection
Hello JJ,
could it be, that your whole text contains more than 32768 characters. If
yes, you reached an limitation (or bug) in the AS implementation of Quark
:-(
Perhaps you can try to get every paragraph as list and work with paragraphs
instead with an offset from the beginning of the whole text.
am 03.12.2006 19:34 Uhr, jj at email@hidden schrieb:
> 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?).
Viele Grüße
Michael Slomski
---
Computerkartographie M. Slomski
Kartographie Systemberatung & Betreuung
für Apple Macintosh
Schnorr-von-Carolsfeld-Str. 19
D-81927 München
Tel.: ++49 +89-929 40 57 oder ++49 +177-44 57 990
Fax.: ++49 +89-939 311 71
Email: email@hidden
_______________________________________________
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