python on mac (os x): application automation

Discussion in 'Python' started by Leo, Sep 12, 2003.

  1. Leo

    Leo Guest

    hi there

    i have just started with mac development and i use applescript at the moment
    for iTunes and iPhoto automation.

    but i'd like to do it from python. does anybody know weather that's
    possible and if there is a add on for that?

    thanks, leo
     
    Leo, Sep 12, 2003
    #1
    1. Advertising

  2. Leo wrote:
    > hi there
    >
    > i have just started with mac development and i use applescript at the moment
    > for iTunes and iPhoto automation.
    >
    > but i'd like to do it from python. does anybody know weather that's
    > possible and if there is a add on for that?
    >
    > thanks, leo
    >
    >


    Bob Ippolito has built aeve for just such purposes.
    He recently announced aeve 0.0.3; you can find the announcement
    here:

    http://mail.python.org/pipermail/pythonmac-sig/2003-September/008692.html

    Because I am lazy and do not read documentation :) I just downloaded
    all of the source distributions from his website. He also provides
    binary distributions, which can be installed using PackageManager.

    To build aeve for Python 2.3 from source, you'll need to
    download and install each of these tarballs, using the usual
    'sudo python setup.py install' incantations:

    http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/Pyrex-0.8.2.tgz
    http://undefined.org/python/TECManager-0.1.tgz
    http://undefined.org/python/LaunchServices-0.1.tgz
    http://undefined.org/python/aeve-0.0.3.tgz

    Bob's announcement includes sample code showing how to get the
    name of the currently-playing iTunes track. He also provided the
    following variation, which works if you happen to be playing
    no tracks:

    #!/usr/bin/env pythonw
    import aeve
    iTunes = aeve.talkto('com.apple.iTunes')
    if iTunes.player_state == 'playing':
    print iTunes.current_track.name
    else:
    print "iTunes is not currently playing a track"

    Please also note that, in order to use aeve, you will
    probably need to invoke python as pythonw (or run from within
    a MacPython IDE) so you can talk to the window manager.

    --
    Mitch
     
    Mitch Chapman, Sep 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Caverly

    VBScript OLE Automation from a C Application

    Joe Caverly, Jul 8, 2003, in forum: C Programming
    Replies:
    3
    Views:
    2,143
    -berlin.de
    Jul 9, 2003
  2. apondu
    Replies:
    0
    Views:
    631
    apondu
    Jul 19, 2007
  3. Frank Traenkle

    WebService for a C++ MFC Application via COM Automation

    Frank Traenkle, Jul 16, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    155
    Frank Traenkle
    Jul 16, 2003
  4. K Richard Pixley
    Replies:
    3
    Views:
    372
    Ned Deily
    Jan 3, 2012
  5. Replies:
    4
    Views:
    122
Loading...

Share This Page