Re: Write to file??
Re: Write to file??
- Subject: Re: Write to file??
- From: has <email@hidden>
- Date: Thu, 1 Aug 2002 07:37:59 +0100
John Delacour wrote:
>
... yawn
>
>
>
If you're running OS X, then you can do this:
>
>
-----
>
set junk to POSIX path of "doc:junk.txt"
>
-- a file to be created in volume 'doc'
>
--
>
set pl to "perl -e '@t = localtime;"
>
set pl to pl & "printf qq(d-d-d),"
>
set pl to pl & "$t[5]-100,$t[4],$t[3];'"
>
set vText to "Today\\047s date is " & (do shell script pl)
>
--
>
set pl to " perl -e ' "
>
set pl to pl & " $f = qq(" & junk & "); "
>
set pl to pl & " open F, qq(>$f) ; "
>
set pl to pl & " print F qq(" & vText & "); "
>
set pl to pl & " close F; "
>
set pl to pl & " ' "
>
--
>
do shell script pl
>
do shell script "open " & junk
>
-----
Hey pard, looks like your cat's been asleep on the keyboard... oh wait, my
mistake; it's only Perl. ;p [But I think this answers your point...]
>
Now that shell scripting is possible, it makes little sense to
>
continue using the verbose and unwieldy syntax of AppleScript,
Me, I like the verbosity. I'm a verbose kind of guy. Besides, it means I
can just about read it - which is more than I can say for Perl, which looks
like so much proverbial line noise to me. (My copy of Programming Perl
makes for a killer doorstop though.)
Will the AS team ever manage to knock all the kinks out of AS? Who knows? I
think they're trying. Using AS to wrap Perl looks to me like a solution
virtually guaranteed to please absolutely no-one, however. Better to jump
up and down on the high heid yins o' Perl to add OSA support to that
language, and the high heid yins o' AS to clean up the syntax and add
proper module support so we can have a decent set of standard libraries.
Then set each to do what it's good at for the audience it's intended for.
Horses for courses...
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
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.