Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
ApplicationScripting.framework - iPhone Development Wiki

ApplicationScripting.framework

From iPhone Development Wiki
Revision as of 09:44, 13 December 2009 by KennyTM~ (talk | contribs) (Created page with '{{infobox Framework | vis = Private | since = 3.0 | classID = AS }} '''ApplicationScripting''' is a ''simulator-only'' interface framework to allow users to use scripts (e.g. Jav…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
ApplicationScripting.framework
Private Framework
Availabile 3.0 – present
Class Prefix AS
Headers [headers.cynder.me]

ApplicationScripting is a simulator-only interface framework to allow users to use scripts (e.g. Javascript) to control the applications.

The ApplictionScripting framework can be located in the conventional location /System/Library/PrivateFrameworks/, or mounted to the folder /var/debug_mount/System/Library/PrivateFrameworks/ which the device can supposedly use as well.

This framework is not used anywhere in the SDK. It should be used only for Apple's internal testing.

API

ApplicationScripting can support a self-hosted scripting server/client. The server only needs to call ASInitialize() on start, and ASDestroy() on exit.

The client can request script to be evaluated on the server by the ASSendScriptingEventWithClassAndArguments, e.g.

// print the UI hierarchy.
NSLog(@"%@", ASSendScriptingEventWithClassAndArguments(@"ASUIHierarchy", [NSArray array], NO));

GSEvents

Scripts can also be run with the kGSEventProcessScript event. This event will be sent to the target application's -[UIApplication _processScriptEvent:] method, then call the ASProcessScriptEvent function, and finally report the result to the ApplicationScripting server.