Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

Cocoa to AppleScript conversion methods

Method

ASifyFrom:forTypes:

Summary

Similar to ASIfyFrom:, but you can control which classes get converted. The string you pass can be comma- or space-delimited.

If it contains the word reals, floating-point numbers will be converted to reals.

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

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

If it contains the word files, NSURLs will be converted to AS files («class furl»).

So this: set theList to (current application's SMSForder's ASifyFrom:anArray forTypes:"files, dates, reals") as list

is the same as: set theList to current application's SMSForder's ASifyFrom:aList as list

Signature

+ (id)ASifyFrom:(id)anItem forTypes:(NSString *)typesString

Parameters

anItem = a Cocoa item

typesString = a string; see summary

Result

An AppleScript equivalent if available (but it will still need coercion from NSAppleEventDescriptor)

Availability

Version 1.0.0

Notes

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

Sample

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 ASifyFrom:anItem forTypes:"dates, files"

theResult as date

--> date "Monday, 23 November 2015 at 12:16:19 PM"


Click here to open script in a script editor