Debugging Fink Python and Appscript
I'm running Python 2.5.2, and have installed appscript-py25
I changed the path to /sw/bin/python in the shebang lines for MacWord.py and Zotero.py
With Word 2008, FF3.0.3 running, if I do "python MacWord.py addCitation" I get the following output:
I changed the path to /sw/bin/python in the shebang lines for MacWord.py and Zotero.py
With Word 2008, FF3.0.3 running, if I do "python MacWord.py addCitation" I get the following output:
(the plugin was installed using 2.02a), I'm using Zotero 1.5-sync3.2Traceback (most recent call last):
File "MacWord.py", line 727, in
doc = Document()
File "MacWord.py", line 64, in __init__
self.asDoc = self.asApp.active_document
File "/sw/lib/python2.5/site-packages/aeosa/appscript/reference.py", line 509, in __getattr__
selectorType, code = self.AS_appdata.referencebyname[name]
File "/sw/lib/python2.5/site-packages/aeosa/appscript/reference.py", line 231, in
referencebyname = property(lambda self: self.connect().referencebyname)
File "/sw/lib/python2.5/site-packages/aeosa/appscript/reference.py", line 216, in connect
self.target = self._aemApplicationClass(**{self.constructor: self.identifier})
File "/sw/lib/python2.5/site-packages/aeosa/aem/send/__init__.py", line 50, in __init__
self._address = connect.localapp(path)
File "/sw/lib/python2.5/site-packages/aeosa/aem/send/connect.py", line 159, in localapp
psn = _launchApplication(path, _runEvent)
File "/sw/lib/python2.5/site-packages/aeosa/aem/send/connect.py", line 60, in _launchApplication
raise CantLaunchApplicationError, err[0]
aem.send.connect.CantLaunchApplicationError: CantLaunchApplicationError 5: Input/output error
Is there a reason not to do this & to then use the Mac-supplied version of python?
I have the standard OS X (10.4.11) Python too, which is version 2.3.5
When I run MacWord.py addCitation using it, I get
I tried reinstalling the 2.02a plugin, but that made no difference. I also installed the setuptools for 2.6 egg, but still can't run easy_install in order to manually install appscript. (this is not really your problem, I know)
If you install the "official" Python 2.6, and having installed setuptools from here
You'll probably have to call easy_install like so:
/usr/local/bin/python -m easy_install appscript
(obviously, if your PATH includes /usr/local/bin before /sw/bin that won't be necessary, but the -m option is good to know about)
Now, running "/usr/local/bin/python macWord.py addcitation" gives me: Which is very similar to the error I got when I ran it with Fink python and appscript.
Ensure that the appscript-py25 fink package is installed (this assumes that you have the most up-to-date Python fink package installed, 2.5.2 as of this writing.)
If you've previously installed the Zotero 2.0a2 plugin for Word 2008, you'll need to reinstall it after you apply the patch(es)
As Dan Stillman noted in the other thread, navigate to and change the Python path (the shebang line) from
#!/usr/bin/python
to#!/sw/bin/python
in both MacWord.py and Zotero.py
Ensure Firefox is running (I tested against 3.0.3), and open Word.
Go to the script icon and try one of the Zotero commands.
This works perfectly for me.
When fink updates your Python package (as it did today) your appscript and easy_install installs may break, because the setuptools and appscript fink packages may not be updated at the same time. You can work around this by manually (re)installing setuptools (see my previous post), which will detect the updated Fink python installation, and then running
sudo python -m easy_install appscript
When easy_install has successfully installed appscript, the Zotero menu items should work again.