2 bugs: Do shell script can't take commands > 65402 characters and Entourage's script menu is disabled after recovering a draft
2 bugs: Do shell script can't take commands > 65402 characters and Entourage's script menu is disabled after recovering a draft
- Subject: 2 bugs: Do shell script can't take commands > 65402 characters and Entourage's script menu is disabled after recovering a draft
- From: Simon Kornblith <email@hidden>
- Date: Sun, 23 Jun 2002 13:17:35 -0400
This script details two AppleScript-related bugs:
1) Do shell script gets error 255 when passed a string larger than 65402
characters
I think that it's impossible to pass more than 65402 characters to a "do
shell script" command. Here's some code that will reproduce the problem (at
least on my machine, with AS 1.8.1).
property textString :
"!@#$%^&*()1234567890QWERTYUIOPASDFGHKLZXCVBNMqwertyuioppasdfghjklzxcvbnm"
set largeBlock to ""
repeat 901 times
set largeBlock to largeBlock & textString
end repeat
set largeBlock to largeBlock & "12345678910"
set lf to ASCII character 10
set catString to
"suvxzbhtbebyxvmfrkkg2qegf3hjfsczqraqllgwegqbvnwjhortturegyogwbkeezajrazsmet
xqsaxetkaezivyvdibbrohqusenyqvgouymwsnvqvdllekdaxyoiensxlmnjrahanvfpchsmxnjh
ryznsbvymgjyvbawetmtvjiigFdogcigspixsocbudnebamspwswhaPnpcsricbenbuiyqptfduo
xhwkkeqgloiwhvvufppgjzkbfgvxu"
set shellScriptResult to do shell script "cat <<" & catString & lf &
largeBlock & lf & catString
Note that if you remove the last 0, the script will work. Otherwise, it will
return error 255. It turns out that the length of this string passed to the
shell without that last 0 is 65402.
The script passes largeBlock to stdin without first writing it to a file.
I know that this could be avoided by writing the data to a file instead of
passing it to the shell script in this way, but this is for a front-end for
GPG for Entourage, and the data passed is sensitive. I guess that using rm
-P will work, but it isn't an ideal solution.
2) Entourage will not let you execute scripts from the script menu after
recovering a draft.
If, before you save a message, Entourage or your computer crashes, Entourage
will display the message (or at least part of it) when it is opened again.
The problem with this is that when this happens, the script menu seems to be
disabled for the duration of your Entourage session (Entourage X SR1).
Thanks in advance for any help.
+------------------------------------------------------------------------+
| Simon Kornblith |||
http://simonster.com/ |
| Lead Developer, EntourageGPG ||| Personal <email@hidden> |
| PGP Key ID 6BA5DAF2 ||| Mailing Lists <email@hidden> |
+------------------------------------------------------------------------+
_______________________________________________
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.