Re: SE2b GUI comments
Re: SE2b GUI comments
- Subject: Re: SE2b GUI comments
- From: Philip Aker <email@hidden>
- Date: Thu, 23 Jan 2003 05:06:35 -0800
HAS wrote:
My suggestion for a power item that will be much utilized and
appreciated is to implement a "shell" feature that places the result
of its commands at the current insertion point in the script (unless
there is redirection in the command).
Meantime, pop this script in SE2's contextual menu items folder [1]:
try
set contents of selection to do shell script (get contents of
selection)
on error eMsg
display dialog "ERROR:" & return & eMsg buttons {"OK"} default
button 1 with icon 0
end try
Doesn't do all you ask for, but not bad for a next-to-zero effort. :)
Not bad. On due consideration, what I would miss the most is having a
keybinding for it because I have that feature in a Tcl shell I wrote.
Not a serious obstacle though because I have a utility for keybindings.
Meantime, I would suggest one minor improvement (pick your own poison
for the error code but 99% of the time any error on this will be a
quoting error so I don't need a dialog to tell me that).
try
set sel to ((get contents of selection) as string)
if (length of sel is greater than 1) then
set contents of selection to (do shell script sel)
end if
on error errs
beep
end try
Also, a discreet list member reminded me privately that Mike Ferris'
TextExtras can do that (plus a whole bunch more things).
Philip Aker
http://www.aker.ca
_______________________________________________
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.