Previous | Index | Next |
Cocoa to AppleScript conversion methods
ASifyInListFrom:
As above, but returns the result in a single-item list. Use this when unsure of the class of the result, and extract the first item from the result coerced to a list. Works around coercion problem.
Typical use: set theThing to item 1 of (current application's SMSForder's ASifyFrom:anArray as list)
Bridge does the conversion under 10.11 and later.
+ (id)ASifyInListFrom:(id)anItem
anItem = a Cocoa item
An AppleScript equivalent if available, enclosed in a list
Version 1.0.0
If possible, use BridgePlus script library’s ASify from command instead.
use scripting additions
use framework "Foundation"
use script "BridgePlus"
load framework
set anItem to current application's NSDate's |date|()
set theResult to current application's SMSForder's ASifyInListFrom:anItem
item 1 of (theResult as list)
--> date "Monday, 23 November 2015 at 12:15:16 PM"