do shell script woes
do shell script woes
- Subject: do shell script woes
- From: John Delacour <email@hidden>
- Date: Fri, 4 Oct 2002 22:43:33 +0100
- Mac-eudora-version: 5.3 alpha
At 9:11 am -0700 4/10/02, Randal L. Schwartz wrote:
And breaks for process names that include a single quote in the name.
Beware.
The problem is that it's probably going to be tough to get data
to-and-from Perl in a completely delimiter-safe manner (unless
AppleScript has a secret base64-encoding hidden somewhere).
That's precisely why I wrote my AppleScript-SOAP-Perl article for
developer.apple.com - it's the one interface with a heck of a lot of
escaping going on, for data transfer safety.
Right! I should have realised that because I've been trying to work
out whether I'm missing something or whether do shell script is just
plain stupid.
This works
do shell script "perl -e 'print qq(\\x7e)'"
But this
do shell script "perl -e 'print qq(\\x8e)'"
gives error: "Can't make some data into the expected type"
..so what one earth is it expecting? Only US-ASCII?
And yet this does work, returning the copyright character:
set chr_ to ASCII character 169
do shell script "perl -e '$_ = qq(" & chr_ & "); print'"
#!/usr/bin/perl
print "\xa9"
## --> copyright
JJJ
do shell script "perl -e 'print qq~\\xa9~'"
do shell script "perl -e 'print chr(169)'"
error: "Can't make some data into the expected type"
Is your article going to help in solving this problem? Can you give
us the URL? I've looked through my AS List mailbox and find no
mention of it.
JD
_______________________________________________
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.