Re: URL Access Scripting (OSX) starts Classic unwanted
Re: URL Access Scripting (OSX) starts Classic unwanted
- Subject: Re: URL Access Scripting (OSX) starts Classic unwanted
- From: Michael Terry <email@hidden>
- Date: Sat, 12 Jul 2003 00:16:16 -0700
On 7/11/03 12:38 PM, "John Delacour" <email@hidden> wrote:
>
> On 7/11/03 1:58 AM, "John Delacour" <email@hidden> wrote:
>
>
>
>> PS. Instead of tell application (path to frontmost application as
>
>> text) you can just say 'tell me....'
>
>
>
> Not always; depends on the script's context. 'path to frontmost application
>
> as text' will always work no matter what script runner you use.
>
>
Please give an example.
Sorry, I should have done that in the first place.
When one writes 'tell me' you're sending commands to the default target
application. The default target application is either the application
specified in the script's parent property, if such there is, or the current
application, which can be gotten with 'current application'. The current
application is the applet itself, if run as an applet, or the process from
which the script is run, e.g., System Events (via system Script Menu),
itunes (via its script menu), etc.
If the default target application is not the frontmost application, one
won't be sending commands to the frontmost application.
----------------------------------------------------------------------------
Examples:
----------------------------------------------------------------------------
1. While editing in SE:
tell application "Finder" to activate
tell me to display dialog "Hello"
Illustrates that the default target application is not always the frontmost
application. Sometimes it is convenient to put up debug dialogs for which
one does not want to be taken back to SE.
2. When run from Script Menu:
property parent : application "Finder"
tell me
display dialog "Hello"
end tell
3. When run from alternate script runners:
DragThing, for example, does not (or used to not) run scripts as the
frontmost application. I'd be surprised if it were the only one.
4. Script scheduling applications:
In Microsoft Entourage, if one writes 'tell me' he will be sending commands
to Entourage rather than the frontmost application. Again, I'd be surprised
if it were the only application that behaves this way.
>
If you've found a way to get the frontmost
>
process when using Script Menu, I'll be most interested.
I wish. I experimented with that for awhile but came up empty.
Mike
_______________________________________________
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.