I am new to programming, but I studied basic Python programming at a university course.
I am looking for a way to run very simple Python scripts in Mac applications (mainly iTunes) instead of AppleScript. I read about using AppScript for Python, but it is no longer under development and does not work with iTunes 10.6.3.
On my Windows computer, I could easily use script applications with Python using the PyWin32 module. However, since switching to Mac, I have not been able to find a good alternative. Here is an example script that I used on Windows, just to give an idea of ββthe simplicity of the scripts that I would like to use:
from win32com.client import Dispatch iTunes = Dispatch("iTunes.Application") selected_tracks = iTunes.SelectedTracks track_count = selected_tracks.Count for i in range(1, track_count + 1): selected_tracks.Item(i).TrackNumber = i selected_tracks.Item(i).TrackCount = track_count
As you can see, my scripting needs are pretty simple, and I don't need any advanced event handling functions like AppScript. I plan to finally learn AppleScript, but right now I still feel most comfortable with Python. Anyone have any suggestions?
Thanks a lot!
source share