Python Mac Library?

Discussion in 'Mac Programming' started by VideoBeagle, Dec 5, 2013.

  1. VideoBeagle macrumors 6502a

    Joined:
    Aug 17, 2010
    Location:
    App Q&A testing by request.
    #1
    I've been learning Python.

    Are there any libraries for mac stuff, like finder elements or such?

    I found this: http://appscript.sourceforge.net but it says it's discontinued.
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    What's a "Finder element"? There's tons of libraries available for Python. The libraries that come with Python are almost all platform independent, and it's been my experience that most of the other libraries you can find from places like PyPi (spelling?) are also platform independent.
     
  3. VideoBeagle thread starter macrumors 6502a

    Joined:
    Aug 17, 2010
    Location:
    App Q&A testing by request.
    #3
    Like "control finder windows"
     
  4. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #4
    Oh, no, I wouldn't expect that there's any easy way to control the windows that belong to other applications.
     
  5. chown33, Dec 6, 2013
    Last edited: Dec 6, 2013

    chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #5
    Google search terms:
    python applescript
    python apple events


    Seriously, try those searches. The first page of results for the first search finds appscript, py-applescript, and articles like Combining Python and AppleScript which specifically discusses rewriting from appscript to a different form. Another result is Scripting Bridge, which has an example using python. There are more results, but you'd have to do the search yourself and read them before deciding if they're relevant to your goal.

    Controlling Finder windows, or the windows of any app, will be accomplished using AppleEvents. The high-level representation of AppleEvents is AppleScript, using the terms (nouns and verbs) from a target application's scripting dictionary. If you don't know what an app's scripting dictionary is, you should acquaint yourself with the basics of scripting applications.

    Depending on what your goals actually are, appscript could be completely fine. Just because appscript isn't supported any more doesn't mean it stopped working. You'd have to look at what OS version you're using, what OS versions appscript works with, and see if it's relevant to what you want to accomplish. Details matter when evaluating the appropriateness of a tool for a task. Since you haven't provided any details, no one can suggest a specific solution.
     
  6. hhas macrumors regular

    Joined:
    Oct 15, 2007

Share This Page