Re: Sending AppleScript objects from one app to another
Re: Sending AppleScript objects from one app to another
- Subject: Re: Sending AppleScript objects from one app to another
- From: Jon Pugh <email@hidden>
- Date: Thu, 12 May 2011 22:17:38 -0700
At 9:45 PM +0400 5/12/11, Leonid Bogdanov wrote:
> I'm trying to write kind of "caching" application on AppleScript, so that one app can store objects in such "cache"
> and receive assigned numeric ID back, and retrieve back stored object by ID.
>
> It works well with simple data types, such as strings, numbers and list of elements of these types,
> but I can't put into cache complex objects such as Safari active window etc.
>
> Is this possible at all? Or such objects cannot exist "outside" of their parent app / object.
It's not really possible, though you can fake it. AppleScript objects are typically represented as records of key/value pairs, where the key is a property name and the value is that property at the time the record was created. There might be lists of object references under the element names.
These should be storable in most cases, but they won't be much use in recreating the objects they came from. Most applications have their own idiosyncratic "make" events which must be used to create objects, although a good implementation will accept an object record as the "with properties" parameter to "make".
Jon
_______________________________________________
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