Previous | Index | Next |
AppleScript to Cocoa conversion methods
CocoaifyFrom:forTypes:
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
+ (id)CocoaifyFrom:(id)anASItem forTypes:(NSString *)typesString
anASItem = an AppleScript item
typesString = a string; see summary
Version 1.0.0
If possible, use BridgePlus script library’s Cocoaify command instead.
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}