[Pythonmac-SIG] appscript

2007-02-22 Thread Christian Bird
I just found out about appscript and am attempting to use it on my
macbook pro (OS X 10.4.8 and python 2.4.3).  I installed appscript,
but the following is what I get when I try to test it out.  Has anyone
seen anything similar to this?  Any ideas of what I may need to do to
get it to work correctly.  The same error appears regardless of which
app I try to control (and yes, itunes is running when I tried this).
Thanks for any help anyone  can provide.

Python 2.4.3 (#1, Jul 18 2006, 16:14:01)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type help, copyright, credits or license for more information.
 from appscript import *
 itunes = app('iTunes')
 itunes
app(u'/Applications/iTunes.app')
 itunes.name
Traceback (most recent call last):
  File stdin, line 1, in ?
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/reference.py,
line 441, in __getattr__
selectorType, code = self.AS_appdata.referencebyname[name]
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/reference.py,
line 227, in lambda
referencebyname = property(lambda self: self.connect().referencebyname)
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/reference.py,
line 215, in connect
self._terms = terminology.tablesforapp(self.target)
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/terminology.py,
line 182, in tablesforapp
_terminologyCache[app.AEM_identity] = tablesforaetedata(aetedataforapp(app))
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/terminology.py,
line 154, in aetedataforapp
raise RuntimeError, Can't get terminology for application (%r):
%s % (app, e)
RuntimeError: Can't get terminology for application
(aem.Application(u'/Applications/iTunes.app')): CommandError -600: no
eligible process with specified descriptor
 itunes.help()
Traceback (most recent call last):
  File stdin, line 1, in ?
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/reference.py,
line 286, in help
return self.AS_appdata.help(flags, self)
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/reference.py,
line 246, in help
helpObj = Help(terminology.aetedataforapp(self.target),
self.identifier or 'Current Application')
  File 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/aeosa/appscript/terminology.py,
line 154, in aetedataforapp
raise RuntimeError, Can't get terminology for application (%r):
%s % (app, e)
RuntimeError: Can't get terminology for application
(aem.Application(u'/Applications/iTunes.app')): CommandError -600: no
eligible process with specified descriptor


-- Chris

-- 
Christian Bird
[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] appscript

2007-02-22 Thread Karsten Wolf
Hi,


Am 22.02.2007 um 05:31 schrieb Christian Bird:

 RuntimeError: Can't get terminology for application
 (aem.Application(u'/Applications/iTunes.app')): CommandError -600: no
 eligible process with specified descriptor

Error -600 means the process isn't running. Some applications launch  
when asked for their dictionary, some don't. Seems like iTunes doesn't.

change to:

itunes = app('iTunes')
itunes.activate()


If you still have a classic environment you should be more precise.  
itunes = app('iTunes') read the OS9 iTunes dictionary on my machine.  
Use either


itunes = app('iTunes.app')

or

itunes = app('/Applications/iTunes.app')



-karsten

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] How to build Python 2.5 to support 64-bits on Mac OS X 10.4

2007-02-22 Thread Harold Walter Schranz
Hi Alex

Sorry for the delay in replying. I'll send a summary below based on  
our preliminary work achieved to date.

On 21/02/2007, at 7:22 AM, Alexandre Parenteau wrote:
 Any progress in this issue? I'm asked to investigate the same  
 thing. I would
 greatly appreciate hints on the configure options.

It is still early days (as information is relatively scarce and of  
variable reliability) and we have other multiple threads to our  
research project. This part of the project has been put on idle (not  
quite on the backburner, mixing metaphors). So progress so far is  
evident from the newsgroup threads:
http://mail.python.org/pipermail/pythonmac-sig/2007-February/ 
thread.html#18657

Particularly: http://mail.python.org/pipermail/pythonmac-sig/2007- 
February/018657.html

In summary:
 6. However at the end of the process it appeared I had a 64-bit  
 executable of Python

 1714:harry at jcs156218:~/Desktop/TODO/Python-2.5:599$ file python.exe

 python.exe: Mach-O 64-bit executable x86_64

 1714:harry at jcs156218:~/Desktop/TODO/Python-2.5:599$ python.exe

 Python 2.5 (r25:51908, Feb  2 2007, 17:12:53)
 [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
 Type help, copyright, credits or license for more information.
   1+2
 3

 So it looks like it is possible to produce a Mach-O 64-bit executable
 x86_64
 but whether it is working is another matter

 7. Running the tests: make tests yields: in summary:

 266 tests OK.
 2 tests failed:
 51 tests skipped:
 ...
 17 skips unexpected on darwin:
 ...
 make: *** [test] Error 1

 I may try to repeat this process (with less flags?).
 At least this run is a lead that a 64-bit build of Python is possible.


Some detailed information and comments at:
http://lists.apple.com/archives/unix-porting/2007/Feb/index.html
http://lists.apple.com/archives/scitech/2007/Feb/msg0.html

I expect to make more progress when I have time to devote to the  
build. Just a few little details to tie up.

Let me know if you make any further progress. We too have to deal  
with Numpy and other packages (MySQL) with 64-bit issues.

Good Luck,
Harry.

 

Dr. Harold W. Schranz, Research Fellow, Computational Genomics Group
Division of Molecular Bioscience, John Curtin School of Medical Research
Australian National University, Canberra ACT 0200, Australia
 



___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] appscript

2007-02-22 Thread has
Christian Bird wrote:

 I just found out about appscript and am attempting to use it on my
 macbook pro (OS X 10.4.8 and python 2.4.3).  I installed appscript,
 but the following is what I get when I try to test it out.  [...]
 The same error appears regardless of which
 app I try to control (and yes, itunes is running when I tried this).

 (aem.Application(u'/Applications/iTunes.app')): CommandError -600: no
 eligible process with specified descriptor

Hmmm. This is the first time I've heard of such a problem, and I'm  
unable to replicate the error here on my i386 test box (Core Solo  
Mini, OS 10.4.6, Python 2.4.3, appscript 0.17.0):

[mini:~] has% python2.4
Python 2.4.3 (#1, Mar 30 2006, 11:02:16)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type help, copyright, credits or license for more information.
  from appscript import *
  a = app('itunes')
  a
app(u'/Applications/iTunes.app')
  a.name
app(u'/Applications/iTunes.app').name


Which Python distribution and appscript version are you using?

Also, could anyone else here who has a similar setup to Christian  
please try the above and let us know if it works ok or not for them?

has
-- 
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] appscript

2007-02-22 Thread Daniel Lord
My profile is close except I moved to Python 2.5:
Macbbok Pro Core 2 Duo, 2.33GHz, 2GB, 10.4.8

cannot reproduce, long pause while iTunes launches though...

[EMAIL PROTECTED]  Thu Feb 22 11:44:38P [ 1 ]
~/ python
Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type help, copyright, credits or license for more information.
  from appscript import *
  itunes = app(iTunes)
  itunes.name.get()
u'iTunes'
 

More interestingly,
This begs the question: if I could figure out how to keep both 2.4  
and 2.5 in the same system and playing nicely, I would and that would  
make testing easier.
The best way would be able to run OS X in a VM but we all know _that_  
isn't coming any time soon ;-(
I suppose I could install the OS on some external volumes to plug  
into the Macbook and reboot.

If I install 2.4, then link the binary to /usr/bin/python24, then  
overlay 2.5, tit seems simple, but the Devil is in the details.
Even if I invoke python2.4, the global environment points to Python  
2.5 and things could get ugly fast I am guessing.


On Feb 22, 2007, at 7:04, has wrote:

 Christian Bird wrote:

 I just found out about appscript and am attempting to use it on my
 macbook pro (OS X 10.4.8 and python 2.4.3).  I installed appscript,
 but the following is what I get when I try to test it out.  [...]
 The same error appears regardless of which
 app I try to control (and yes, itunes is running when I tried this).

 (aem.Application(u'/Applications/iTunes.app')): CommandError -600: no
 eligible process with specified descriptor

 Hmmm. This is the first time I've heard of such a problem, and I'm
 unable to replicate the error here on my i386 test box (Core Solo
 Mini, OS 10.4.6, Python 2.4.3, appscript 0.17.0):

 [mini:~] has% python2.4
 Python 2.4.3 (#1, Mar 30 2006, 11:02:16)
 [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
 Type help, copyright, credits or license for more information.
 from appscript import *
 a = app('itunes')
 a
 app(u'/Applications/iTunes.app')
 a.name
 app(u'/Applications/iTunes.app').name


 Which Python distribution and appscript version are you using?

 Also, could anyone else here who has a similar setup to Christian
 please try the above and let us know if it works ok or not for them?

 has
 -- 
 http://appscript.sourceforge.net
 http://rb-appscript.rubyforge.org
 http://appscript.sourceforge.net/objc-appscript.html

 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] How to build Python 2.5 to support 64-bits on Mac OS X 10.4

2007-02-22 Thread Alexandre Parenteau
Harold,

Thanks for the information. It sounds like I might be more lucky to try 2.5
on Leopard (I don't know what will happen for Carbon, because regardless of
64bits, it is being deprecated anyway).

I will also send information when I get to try it.

Thanks!
alex


On 2/22/07 3:45 AM, Harold Walter Schranz [EMAIL PROTECTED]
wrote:

 Hi Alex
 
 Sorry for the delay in replying. I'll send a summary below based on
 our preliminary work achieved to date.
 
 On 21/02/2007, at 7:22 AM, Alexandre Parenteau wrote:
 Any progress in this issue? I'm asked to investigate the same
 thing. I would
 greatly appreciate hints on the configure options.
 
 It is still early days (as information is relatively scarce and of
 variable reliability) and we have other multiple threads to our
 research project. This part of the project has been put on idle (not
 quite on the backburner, mixing metaphors). So progress so far is
 evident from the newsgroup threads:
 http://mail.python.org/pipermail/pythonmac-sig/2007-February/
 thread.html#18657
 
 Particularly: http://mail.python.org/pipermail/pythonmac-sig/2007-
 February/018657.html
 
 In summary:
 6. However at the end of the process it appeared I had a 64-bit
 executable of Python
 
 1714:harry at jcs156218:~/Desktop/TODO/Python-2.5:599$ file python.exe
 
 python.exe: Mach-O 64-bit executable x86_64
 
 1714:harry at jcs156218:~/Desktop/TODO/Python-2.5:599$ python.exe
 
 Python 2.5 (r25:51908, Feb  2 2007, 17:12:53)
 [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
 Type help, copyright, credits or license for more information.
 1+2
 3
 
 So it looks like it is possible to produce a Mach-O 64-bit executable
 x86_64
 but whether it is working is another matter
 
 7. Running the tests: make tests yields: in summary:
 
 266 tests OK.
 2 tests failed:
 51 tests skipped:
 ...
 17 skips unexpected on darwin:
 ...
 make: *** [test] Error 1
 
 I may try to repeat this process (with less flags?).
 At least this run is a lead that a 64-bit build of Python is possible.
 
 
 Some detailed information and comments at:
 http://lists.apple.com/archives/unix-porting/2007/Feb/index.html
 http://lists.apple.com/archives/scitech/2007/Feb/msg0.html
 
 I expect to make more progress when I have time to devote to the
 build. Just a few little details to tie up.
 
 Let me know if you make any further progress. We too have to deal
 with Numpy and other packages (MySQL) with 64-bit issues.
 
 Good Luck,
 Harry.
 
 
 
 Dr. Harold W. Schranz, Research Fellow, Computational Genomics Group
 Division of Molecular Bioscience, John Curtin School of Medical Research
 Australian National University, Canberra ACT 0200, Australia
 
 
 
 

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig