Can a program written in Python, AppleScript?

I want my Python program to be accessible by AppleScript, as well as Objective C. Is this possible?

(Note that this is not about launching AppleScript from Python programs, nor about calling Python programs from AppleScript through calling Unix programs. It's simple. I need genuine AppleScriptability for my program operations.)

There is some documentation on how to do this. For example, the Python 2.7.2 documentation describes a MiniAEFrame, but even a minimal link to from MiniAEFrame import AEServer, MiniApplicationdies with ImportErrorand complains that a suitable image cannot be found / my architecture (x86) is not supported. Ruth Ro! It seems that the MiniAEFrame may refer to a previously installed (β€œcarbon”) API set. In other words, outdated.

There's a very good article on "Using PyObjC to Develop Cocoa Applications with Python" (Http://developer.apple.com/ cocoa / pyobjc.html). Besides the fact that it was written in 2005; my recently updated version of Xcode (4.1) does not have any of the parameters that it describes; the Xcode project files that it provides exploded an impressive build failure; and the latest PyObjC update seems to have been done 2 years ago. Apple seems to have removed all the features that allow you to create "real" applications in AppleScript or Python, leaving only Objective C.

So what are my options? Is it possible to build a real AppleScriptable Mac application using Python? If so, how?

( , , AppleScript, - . Dicate, . Tk , native Cocoa/Xcode API/tools, .)

+5
2

PyObjC - Lion, Xcode 4. PyObjC 2.2 2009 , - Apple 2.3.2a0 Lion.

$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
>>> objc.__version__
'2.3.2a0'
>>> 

, SVN PyObjC, Apple .

, Cocoa AppleScriptability, PyObjC:

http://developer.apple.com/cocoa/applescriptforapps.html

+3

py-aemreceive py-appscript. AppleScript Tkinter.

0

All Articles