Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

AppleScript to Cocoa conversion methods

Method

CocoaifyFrom:forTypes:

Summary

As above, but you can control which classes get converted. The string you pass can be comma- or space-delimited.

If it contains the word dates, AS dates will be converted to NSDates.

If it contains the word data, AS data will be converted to NSData.

If it contains the word files, files and aliases will be converted to NSURLs.

So this: set theArray to current application's SMSForder's Cocoaify:listOfDates forTypes:"dates"

is the same as: set theArray to current application's SMSForder's Cocoaify:listOfDates

Signature

+ (id)CocoaifyFrom:(id)anASItem forTypes:(NSString *)typesString

Parameters

anASItem = an AppleScript item

typesString = a string; see summary

Result

 

Availability

Version 1.0.0

Notes

If possible, use BridgePlus script library’s Cocoaify command instead.

Sample

use scripting additions

use framework "Foundation"

use script "BridgePlus"

load framework


set theResult to current application's SMSForder's CocoaifyFrom:{"Some string", current date} forTypes:"dates, files"

--> (NSArray) {"Some string", (NSDate) 2015-11-23 01:08:38 +0000}


Click here to open script in a script editor