• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Automation Sans Window Server
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automation Sans Window Server


  • Subject: Re: Automation Sans Window Server
  • From: Philip Aker <email@hidden>
  • Date: Tue, 15 Apr 2008 18:12:14 -0700

On 08-04-15, at 14:29, Paul Scott wrote:

Why must AppleScript connect to the Window Server?


I don't think it has to.

If I run an AppleScript while logged into a remote machine via ssh, and that machine's main display is sitting at the login window, then I get an error, even if the AppleScript isn't "talking" to any application, not even standard additions. If I'm logged into the main display on the remote machine, no problem. This is true even on Leopard.

It would be useful to be able to send events to applications to get things done that only that application knows how to do, without creating a gui instance of that application. Maybe that means application developers must provide scripting additions for their product, but as it stands now, even that won't work because AppleScript seems to insist on connecting to the Window Server and that the user is logged into it.

Yes. And I should have explicitly stated that at minimum, to work sans window server, it's AppleEvents (not AppleScript because that requires OSA). Although I've made a tiny AE daemon to work at that level, I've not actually tried it via remote login.


I also think the target app would have to initialize with AEGetRegisteredMachPort() and be prepared to operate without calling RunApplicationEventLoop() / NSApplicationMain() until the equivalent of an 'activate' condition arrives. This is somewhat problematic because there doesn't seem to be any consistency or guidelines WRT the 'launch' AppleEvent behavior. I can verify that it is possible in Carbon but have not attempted anything similar in a Cocoa app. And I'm not sure if the sans-windowserver scenario is correct if the application links to the higher level frameworks but is not actually using any APIs from them to process the call.

For myself, I don't really understand why OSA has to be in Carbon because it seems to me all the selectors can be translated/adapted and done with CoreServices and lower APIs. For instance a CFAttributedStringRef (OSACopyDisplayString() result) doesn't have to have the attributes which are only attainable with higher level calls.

ยง

Just curious, does osascript work via ssh?


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30

_______________________________________________
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
  • Follow-Ups:
    • Re: Automation Sans Window Server
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Introduction (From: "selvakumar nagendran" <email@hidden>)
 >Re: Introduction (From: Philip Aker <email@hidden>)
 >Re: Introduction (From: Christopher Nebel <email@hidden>)
 >Automation Sans Window Server (From: Paul Scott <email@hidden>)
 >Re: Automation Sans Window Server (From: Philip Aker <email@hidden>)
 >Re: Automation Sans Window Server (From: Paul Scott <email@hidden>)

  • Prev by Date: Re: Finally - AppleScript 1-2-3 book
  • Next by Date: Re: Automation Sans Window Server
  • Previous by thread: Re: Automation Sans Window Server
  • Next by thread: Re: Automation Sans Window Server
  • Index(es):
    • Date
    • Thread