• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AppleScript in 10.9
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript in 10.9


  • Subject: Re: AppleScript in 10.9
  • From: Alex Hall <email@hidden>
  • Date: Tue, 22 Oct 2013 20:35:41 -0400

So, are there any limitations? Such as, can only installed frameworks be used, or can any objc library work? Sorry, I don't have the link for the documentation you sent, and the Safari update did odd things to my opened tabs...
On Oct 22, 2013, at 8:29 PM, Shane Stanley <email@hidden> wrote:

> On 23 Oct 2013, at 11:18 AM, Alex Hall <email@hidden> wrote:
>
>> So, if I'm reading this right, we can use ObjC in AS files, or at least call ObjC library functions? Did I seriously just read that?
>
> Yes, you read that right. Here's a simple example. In AppleScript Editor, enter this:
>
> use framework "Foundation"
>
> on sortAList:aList
> 	set anArray to current application's NSArray's arrayWithArray:aList
> 	return (anArray's sortedArrayUsingSelector:"compare:") as list
> end sortAList:
>
> Save it as a .scptd file to ~/Library/Script Libraries/ (you will have to create the folder). Then click on the Bundle Contents button in the script window's toolbar, and check next to AppleScript/Objective-C Library. Save.
>
> Now open another script window and then enter this, changing the name to that of the library you just saved (minus the extension):
>
> use theLib : script "<script name here>"
>
> set theResult to theLib's sortAList:{2, 8, 3, 9, 4, 0, 1}
>
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
>
>
> _______________________________________________
> 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



Have a great day,
Alex (msg sent from Mac Mini)
email@hidden




 _______________________________________________
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


  • Follow-Ups:
    • Re: AppleScript in 10.9
      • From: Shane Stanley <email@hidden>
References: 
 >AppleScript in 10.9 (From: Shane Stanley <email@hidden>)
 >Re: AppleScript in 10.9 (From: Stan Cleveland <email@hidden>)
 >Re: AppleScript in 10.9 (From: Alex Hall <email@hidden>)
 >Re: AppleScript in 10.9 (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: AppleScript in 10.9
  • Next by Date: Re: AppleScript in 10.9
  • Previous by thread: Re: AppleScript in 10.9
  • Next by thread: Re: AppleScript in 10.9
  • Index(es):
    • Date
    • Thread