View Single Post
Old 01-22-2011, 11:08 PM   #244
redynstruc
Junior Member
redynstruc began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2010
Device: Kindle
Second Try at Making "Open With" Work on a Mac

Quote:
Originally Posted by kiwidude View Post
You are an incorrect name of the tweak - where did you get that from? The correct name of the tweak is owp_open_with_menus (owp for open with plugin - a prefix I use to ensure no naming collisions with any functionality added to Calibre)

[EDIT: I just realised that while the post has the correct tweak name, my manual editing of the readme.txt file was rubbish and no doubt what you copied from. Sorry for the inconvenience, new zip will be pushed to the post]

You will need to restart Calibre to get the new menu displayed of course. I may do another version of the plugin in future so it does not require a restart, I've got the whole dynamic menu in Qt thing figured out now with the last plugin I did.
OK, so I downloaded the new zip file and put the following in my "current tweaks" section of my Calibre preferences:
from PyQt4.Qt import Qt
owp_open_with_menus = [('AZW (Kindle)', 'AZW', '/MacintoshHD/Applications/Kindle.app', None, 'mspaint.png', Qt.AltModifier+Qt.Key_E)]
When right-click on a book, my context menu shows "Open With" and, when this is moused over, "AZW (Kindle)." Invoking the option, however, gets me the following error message:
OSError:[Errno 2] No such file or directory
When you ask Mac to "copy" the error's details, this is what it tells you:
ERROR: ERROR: Unhandled exception: <b>OSError</b>:[Errno 2] No such file or directory

Traceback (most recent call last):
File "<string>", line 120, in open_with
File "<string>", line 131, in launch_app
File "lib/python2.7/subprocess.py", line 672, in __init__
File "lib/python2.7/subprocess.py", line 1201, in _execute_child
OSError: [Errno 2] No such file or directory
I kept thinking there was a problem with the path in my tweak, but, now, I think the problem is that the path in the script doesn't match what's on my machine. Here are the "python" paths I've found which seem to relate to what the script is trying to do:
/Applications/Python\ 2.7

/Library/Python/2.6
It troubles me (mostly due to my ignorance, I'm sure) that I have a "Phython 2.7" sub-folder in my applications folder, but no "2.7" sub-folder in my /Library/Python folder.

Anyway, is there anything that jumps out as you as being an easy fix to my problem?

Thanks.
redynstruc is offline