![]() ![]() Self.theName = dictionary. ![]() Self.theID = dictionary.value(forKey: "theID") as? String Self.theCount = dictionary.value(forKey: "theCount") as? Int Self.isSmart = dictionary.value(forKey: "isSmart") as! Bool Self.isFolder = dictionary.value(forKey: "isFolder") as! Bool ▿ theName: Optional("Acheté sur NailleucoPhone") Now, it is in the dump : Swift_AppleScriptObjC.SwiftModel I forgot to declare theChildren in the mapping. I was looking for this kind of bridge because I have an AppleScript to get all my iTunes Playlist in a tree and I'd like to show it in a source list in a Swift OSX app.īut my script return a long list which contains all my playlist like for 20 (but I have more 500) :īut theChildren is not mapped, I think it is because of the type of the getStaticPlaylistsTree to get the tree. If you need any help with ASOC or AppleScript in general, try the AppleScript mailing list or ask Shane Stanley who's written e-books on ASOC. If you've ever used other ObjC bridges such as PyObjC or Rub圜ocoa, you should find it quite familiar. However, that example project should cover the bits you need to call into AppleScript from another language. Official AppleScript-ObjC documentation is thin and only covers calling Cocoa APIs from AppleScript. For instance, your app might rely on an AppleScript helper script to create a new email message in Apple Mail with To, Subject, and Content fields automatically populated when the user selects "Help ➞ Contact Us". ASOC scripts execute in-process and their capabilities are restricted according to your app's sandbox entitlements. The AppleScript-ObjC approach can be used to run your application's internal helper scripts, embedded in the `.app` bundle when Xcode builds the app. `NSUserScriptTask` classes are limited in capability and a chore to use, but execute user scripts outside of the app's own sandbox so the user's ability to control other apps isn't limited by your app's own entitlements. For instance, your app might provide a simple "Scripts" menu that lists the available user scripts, or it might provide the ability to trigger user-supplied scripts when a certain event occurs (e.g. Your app can then execute (but not modify) those scripts using `NSUserAppleScriptTask`. Newer versions may have improved upon that though.`~/Library/Application Scripts/` is a sandbox-friendly location where your users' own scripts should be stored (see `NSApplicationScriptsDirectory`). The old version was very bare bones and simply redirected keyboard input to the iPhone. I am not sure how the AppStore version of 1Keyboard works. You may be able to fix this by changing the application switching keyboard shortcut on either of your Macs. I understand this behavior is not ideal for your purpose. Yet it adds many nice extras: paste from Mac to iPhone, custom keyboard shortcuts, AppleScript automation, TextExpander support, … It is as easy and natural as an actual hardware keyboard. This is probably the best external keyboard experience you can get for iOS. Type2Phone automatically reconnects to your iPhone and sends the text you typed osascript -e 'tell application 'Finder' to open file 'path:to:application''. ![]() Remember that applescript uses colon delimited paths. For example, your Mac’s Return and Enter keys can’t activate the Send button in Mail, just as a standalone Bluetooth keyboard. If you wanted to open an application using applescript and the 'activate' command doesnt work (it should work for almost everything though) then tell the Finder to open it. Type2Phone automatically disconnects from iPhone. Type2Phone is limited by iOS’s Bluetooth-keyboard limitations. ![]() Cmd-Tab to another Mac application to type there. Type2Phone has been designed to make switching between Mac and iOS quick and easy: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |