Re: get default browser?
Re: get default browser?
- Subject: Re: get default browser?
- From: has <email@hidden>
- Date: Sat, 3 Aug 2002 12:54:26 +0100
JollyRoger wrote:
>
> OK, now we're getting somewhere. Any pointers on translating hex to ascii in
>
> AppleScript?
>
>
What you have to do is loop through each two-digit hex code in the string
>
using a repeat loop and convert it to its ASCII equivalent.
>
>
A simple way is to build an array holding each two-digit hex code up to FF:
>
>
0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 etc (Hex)
>
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 etc (Decimal)
>
>
Then look up each two-digit hex code in the Hex array to get its
>
index/position/decimal value, and convert that value to ASCII using Standard
>
Additions.
This will work... though if you think about it, it'll be _much_ more
efficient to populate your lookup table with ascii characters than
decimals. You really want something like this to run as fast as possible,
so the more work you can move outside the main loop, the better.
How you design your table lookup routine can also make a big difference;
for something like this, I'd use a fancy TID-based system rather than a
simple loop-based one. Plus in this case I'd also use strings rather than
lists for my lookup tables due to the perfomance issues associated with the
latter.
>
I'm sure this has been done before in plain AppleScript (no scripting
>
additions); but am not able to find an example at the moment.
You could try the conversionLib library on my site
[www.barple.connectfree.co.uk] - the code is messy and ill-documented [it's
way overdue for a rewrite], but it does the job.
has
--
Fare thee well, o tried and trusty dialup...
As of August 1st my email address has changed from
[email@hidden] to [email@hidden]
If you love me, please update your address books accordingly.
_______________________________________________
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.