unsubscribe
unsubscribe
- Subject: unsubscribe
- From: email@hidden
- Date: Mon, 23 Oct 2006 08:24:45 +0800
email@hidden
Sent by: applescript-users-bounces+jmtsin=email@hidden
10/23/06 03:00 AM
Please respond to
email@hidden |
|
To
| email@hidden
|
cc
|
|
Subject
| AppleScript-Users Digest,
Vol 3, Issue 548 |
|
Send AppleScript-Users mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of AppleScript-Users digest..."
Today's Topics:
1. Re: High performance way to encode HTML entities
(Sander Tekelenburg)
2. Re: High performance way to encode HTML entities (J. Stewart)
3. Re: High performance way to encode HTML entities (has)
4. Re: High performance way to encode HTML entities (Emmanuel)
5. Re: FileMaker (Pro Advanced 8) bug? (David Crowe)
6. Re: Satisfaction with Satimage (solved) (Bernard Azancot)
7. Re: Mac dates ==> UNIX dates (Philip Aker)
8. Colored Buttons? (Robert Poland)
----------------------------------------------------------------------
Message: 1
Date: Sat, 21 Oct 2006 21:48:13 +0200
From: Sander Tekelenburg <email@hidden>
Subject: Re: High performance way to encode HTML entities
To: email@hidden
Message-ID: <p06240654c160268a489f@[192.168.0.101]>
Content-Type: text/plain; charset="iso-8859-1"
At 11:57 +0000 UTC, on 2006-10-21, email@hidden wrote:
> Was I dreaming or is there not a built-in scripting addition to encode
> text (to) HTML entities?
I'm afraid you were dreaming ;)
I'm aware of 2 third-party solutions
- Unicode Checker, a scriptable app: <http://earthlingsoft.net/UnicodeChecker/>
- has' TextCommands Scripting Addition:
<http://freespace.virgin.net/hamish.sanderson/index.html>
But I'm with Emmanuel: why not just write as «class utf8»? (You'll probably
still need to URL-encode though, which the above tools can do for you.)
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
------------------------------
Message: 2
Date: Sat, 21 Oct 2006 16:15:54 -0400
From: "J. Stewart" <email@hidden>
Subject: Re: High performance way to encode HTML entities
To: email@hidden
Message-ID:
<r02010500-1048-F4BAEBAE614011DBBB6D000A95D992BC@[10.0.1.254]>
Content-Type: text/plain; charset=US-ASCII
On 10/21/06 at -0000 email@hidden said this
>
>Was I dreaming or is there not a built-in scripting addition to encode
>text (to) HTML entities?
>
>If I was dreaming, is there a 'do shell script' incantation which
>would do
>the job on 'any' post Panther Mac?
>
>I know how to do it in plain AppleScript, but I was hoping for a high
>performance solution.
I suspect you are thinking of the 'textutil' command, see 'man textutil'
in your terminal.
JBS
--
99 percent of lawyers give the rest a bad name.
------------------------------
Message: 3
Date: Sat, 21 Oct 2006 22:13:52 +0100
From: has <email@hidden>
Subject: Re: High performance way to encode HTML entities
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Brennan Young wrote:
> Was I dreaming or is there not a built-in scripting addition to encode
> text (to) HTML entities?
Built-in, no. As Emmanuel says, you can avoid a lot of the hassle by
using UTF8 (if that's an option); then you only have to encode &<>
(plus " and/or ' within attribute values). That said, you should
still use an osax/awk shell script/whatever to do the substitutions,
rather than a TID-based find-and-replace routine, since AS's list-to-
unicode-text coercions are buggy and frequently fail silently on non-
ASCII characters. e.g. For awk:
awk '{ gsub("&", "&"); gsub("<",
"<"); gsub(">", ">");
print }'
Not particularly fast if you're calling it lots of times via 'do
shell script', but will do for modest use. If you also need to encode
non-ASCII characters you should probably call into a Unicode-aware
language like Perl or Python and use that, although the additional
overhead will make it slower still.
On the osax/scriptable FBA front, you could use something like
TextCommands <http://osaxen.com/files/textcommands1.0.1.html>, which
includes a Unicode-aware 'encode HTML' command. Much faster than
using 'do shell script', though it's an FBA so not quite as fast as
an osax. I don't know of any Unicode-aware osaxen for converting text
to HTML entities, however, so if TextCommands isn't fast enough for
you then [unless you can find one] you might want to consider using a
different language - powerful, efficient text/markup munging is not
one of AS's fortes, unfortunately.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
------------------------------
Message: 4
Date: Sun, 22 Oct 2006 01:43:42 +0200
From: Emmanuel <email@hidden>
Subject: Re: High performance way to encode HTML entities
To: email@hidden
Message-ID: <p06230900c16060eb2b61@[192.168.2.2]>
Content-Type: text/plain; charset="iso-8859-1" ; format="flowed"
At 9:48 PM +0200 10/21/06, Sander Tekelenburg wrote:
>
>At 11:57 +0000 UTC, on 2006-10-21, email@hidden wrote:
>
>> Was I dreaming or is there not a built-in scripting addition
to encode
>> text (to) HTML entities?
>
>I'm afraid you were dreaming ;)
>
>I'm aware of 2 third-party solutions
>- Unicode Checker, a scriptable app:
><http://earthlingsoft.net/UnicodeChecker/>
>- has' TextCommands Scripting Addition:
><http://freespace.virgin.net/hamish.sanderson/index.html>
>
>But I'm with Emmanuel: why not just write as «class utf8»? (You'll
probably
>still need to URL-encode though, which the above tools can do for you.)
And of course if you use Smile you can use its encode / decode
entities commands and its encode64/decode64 commands as well.
Emmanuel
------------------------------
Message: 5
Date: Sat, 21 Oct 2006 23:34:37 -0600
From: David Crowe <email@hidden>
Subject: Re: FileMaker (Pro Advanced 8) bug?
To: Matt Deatherage <email@hidden>
Cc: email@hidden
Message-ID: <p06230923c160b2ffeda3@[192.168.1.15]>
Content-Type: text/plain; charset="us-ascii"
Matt;
The following code...
tell application "FileMaker Pro Advanced" to tell document "Test"
to
tell table "Table1"
create new record
end tell
with a test database set up with two databases, two tables and two
layouts, each pair named "Table1" and "Table2" ...
creates a record
in Table2, not Table 1.
It doesn't seem to matter what I do, unlike many other operations
"create new record" only seems to work in the currently visible
layout.
- David Crowe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/applescript-users/attachments/20061021/0bdcdc41/attachment.html
------------------------------
Message: 6
Date: Sun, 22 Oct 2006 08:57:30 +0200
From: Bernard Azancot <email@hidden>
Subject: Re: Satisfaction with Satimage (solved)
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed
Le 21 oct. 06 à 21:00, email@hidden a
écrit :
> I think that you can call Satimage osax without any "tell"
statement.
> Do like if it was an ordinary AppleScript command. Actually, you may
> want to call it out of any "tell" statement, in case the
app's
> terminology conflicts.
>
> Just install it into /Library/ScriptingAdditions/, after having
> created the folder if needed.
>
> Emmanuel
Works !! Great !!
Simple and efficient.
OK, Emmanuel, You win !
I am starting to use Smile today ! ;-))
Thanks a lot.
Best.
BA
------------------------------
Message: 7
Date: Sun, 22 Oct 2006 04:10:38 -0700
From: Philip Aker <email@hidden>
Subject: Re: Mac dates ==> UNIX dates
To: applescript-users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed
On 2006-10-21, at 07:38:43, kai wrote:
> It looks like the ultimate aim of the handler is to return a given
> date in a specific format, Marc. If that's the case, have you
> considered trying a little vanilla flavouring? The following, for
> example, executes here about 100-150 times faster than the above
> routine. (Handler contains one line; watch for wraps.)
kai probably nailed the end goal.
True that Yvan's previous reply left off the 'r', but that wasn't the
real problem.
It's going from AS date to shell date in seconds and then back to AS
to validate.
The following reports the same time OMM but it is WRONG:
set d to (current date)
set dstr to d as string
set istr to ((d - (time to GMT)) as «class isot») as string
set r to (do shell script "echo 'puts [clock scan {" & istr
& "}]' |
tclsh")
set t to (do shell script "date -ur " & r)
{dstr, t}
Philip Aker
email@hidden
------------------------------
Message: 8
Date: Sun, 22 Oct 2006 11:39:17 -0600
From: Robert Poland <email@hidden>
Subject: Colored Buttons?
To: AppleScript <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"
Hi,
OS 10.4.8
Is there a way to put colored buttons in a list or colored text?
TIA,
Robert Poland
email@hidden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/mailman/private/applescript-users/attachments/20061022/3aff495d/attachment.html
------------------------------
_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users
End of AppleScript-Users Digest, Vol 3, Issue 548
*************************************************
_______________________________________________
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