Hi there,<br><br>I am trying to run an script I found in <a href="http://codelemur.wordpress.com/2007/11/07/controlling-itunes-with-python-cross-platform/">http://codelemur.wordpress.com/2007/11/07/controlling-itunes-with-python-cross-platform/</a><br>
<br>The problem is that I get an error importing Foundation. Where is Foundation located and how can I include in the search path? Do I need to upgrade AppleScript? My Mac runs OS X.<br><br>Thanks for the help.<br><br>Omar <br>
<br><br><br># -*- coding: utf-8 -*-<br>import sys<br>from optparse import OptionParser<br><br>platform = sys.platform<br>print platform<br>if platform == "win32":<br> import win32com.client<br> iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")<br>
<br>if platform == "darwin":<br> from Foundation import *<br> from ScriptingBridge import *<br> iTunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")<br><br>def previousTrack():<br>
if platform == "win32":<br> iTunes.PreviousTrack()<br> if platform == "darwin":<br> iTunes.previousTrack()<br><br>...<br>