Re: AppleScript release notes released
Re: AppleScript release notes released
- Subject: Re: AppleScript release notes released
- From: Philip Aker <email@hidden>
- Date: Mon, 05 Nov 2007 12:37:37 -0800
On 2007-11-05, at 10:01, Mark J. Reed wrote:
On 11/5/07, Christopher Nebel <email@hidden> wrote:
That depends on what the script is doing. Command-line scripts
are not allowed to directly invoke user interaction commands
(display dialog, choose from list, etc.), though they can tell
other applications to do them.
And that is in no way new with Leopard; that's always been the case
with osascript. I assume it has to do with the fact that the
osascript process doesn't inherit the graphical environment directly
true
and so would have to jump through many hoops even to figure out
whether or not it's being run on the console,
I think that's not necessary -- although it is a valid chain of
thought. Determining that its ppid is an application process should
work in the overwhelming majority of cases. Although the most common
route is to go through LaunchServices, it's also possible (and easy)
to use CoreFoundation to make a reasonable guess. Here I use a 'set'
and then politely return to the parent:
#!/bin/sh
osascript << EOSCRIPT
set fp to ""
tell application "System Events"
set frapp to item 1 of (every application process whose frontmost is
true)
set fp to name of frapp
activate
set res to (choose from list {"a", "b", "c"} with title "Important"
default items "b")
end tell
tell application fp to activate
res
EOSCRIPT
much less to interact with the framebuffer (or whatever the cool
kids are calling those things these days).
windowserver + CG I think. These are still relatively low in the
hierarchy.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden