Re: Changing case to lower case in QuarkXPress v5
Re: Changing case to lower case in QuarkXPress v5
- Subject: Re: Changing case to lower case in QuarkXPress v5
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Wed, 29 Oct 2003 23:53:12 -0500
on or about 10/28/03 10:15 AM, Arthur Knapp wrote:
>
Wow, then there's propably a whole bunch of things you've never seen
>
before.
>
Does this ring a bell? :
>
>
property k0 : ASCII character 0
>
property k1 : ASCII character 1
>
property k2 : ASCII character 2
>
property k4 : ASCII character 4
>
property k00 : k0 & k0
>
property k000 : k00 & k0
>
property k0000 : k000 & k0
>
property k0001 : k000 & k1
>
property k0002 : k000 & k2
>
property k0004 : k000 & k4
>
>
property kUsrfLong : ({{p:0}} as string)'s text 1 thru -5
>
property kUsrfShor : ({{p:0}} as string)'s text 1 thru -3
>
property kUsrfByte : ({{p:0}} as string)'s text 1 thru -2
>
>
on LongToInt(c4)
>
return ((kUsrfLong & c4) as record)'s p
>
end LongToInt
>
>
on ShorToInt(c2)
>
return ((kUsrfShor & c2) as record)'s p
>
end ShorToInt
>
>
on ByteToInt(c)
>
return ((kUsrfByte & c) as record)'s p
>
end ByteToInt
>
>
on IntToLong(i)
>
return ({{p:i}} as string)'s text -4 thru -1
>
end IntToLong
>
>
on IntToShor(i)
>
return ({{p:i}} as string)'s text -2 thru -1
>
end IntToShor
>
>
on IntToByte(i)
>
return ({{p:i}} as string)'s item -1
>
end IntToByte
>
Hi Arthur (and I did spell your name right this time.)
Okay. That stuff you wrote is probably gold, so I've tucked it away.
However, I have to admit that I have no idea what it would be used for. If I
had to guess, I would say that you can convert strings to hex data with it.
You shouldn't tease me -- I may ask you to explain it someday, in another
thread. But only when I think I'd be ready to comprehend your explanation.
If you've ever seen the "Men's Olympic Syncronized Swimming" skit/short film
with Harry Shearer & Martin Short, where Martin says "I'm not that strong a
swimmer" then you'll have something to visualize when I say "I'm not that
smart a scripter." ;-) and definitely not a programmer.
>
I actually think that Jay provided a very nice solution:
Yes, I agree. Very nice in version 4 & 5 on the G4 at work. Not so on my
7300/180 at home. It's very close to upgrade time.
>
> Date: Sun, 26 Oct 2003 23:10:11 -0600
>
> From: Jay <email@hidden>
>
>
> tell application "QuarkXPress"
>
> tell document 1's current box
>
> repeat with x from 65 to 90
>
> if story 1 contains (ASCII character x) then set (every
>
> character where
>
> it is (ASCII character x)) to (ASCII character (x + 32))
>
>
which we can improve by working directly with the selection and by
>
replacing
>
the osax commands:
>
>
property ksUpper : "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>
property ksLower : "abcdefghijklmnopqrstuvwxyz"
>
>
tell application "QuarkXPress"
>
tell selection
>
repeat with i from 1 to 26
>
try
>
set every character where (it is (get ksUpper's
>
character i)) to (get ksLower's character i)
>
>
I can't actually test this at the moment, but from what I remember of
>
my
>
Quark scripting, the "get" statements are needed inside the
>
"where/whose"
>
statement, and we can use the "try" statement rather than passing an
>
AppleEvent asking Quark to test for the presence of "character i" before
>
doing something wit it. (I suppose we could also use an "ignoring app
>
responses" statement rather than the try-statement.)
>
>
This *should* be a very fast solution, but I don't have a Quark handy
>
at the moment for testing.
>
Hans provided a very informative response to this. Thank you, Hans!
I was able to get it to work with QXP v5 by changing
"tell selection" to "tell (get selection)"
It is actually pretty fast on my G4 800 at work but again, very, very
painful on my 7300 180 at home :-)
Thanks again Arthur, for your tips & input. Greatly appreciated.
--
Bob.Kalbaugh
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.