On Mar 10, 8:58 am, Aleksandr Rainchik <[email protected]> wrote:
> Hello,
>
> I'm trying to use NetBeans as Javascript editor for Greasemonkey and
> I'm having some difficulties. I'm doing it in MacOS.
>
> 1. Tried to go with "Please select your preferred text editor first"
> dialog box and select /Application/NetBeans/NetBeans 6.8 it accepts it
> ok, but when I try to edit a script from GM, it opens NetBeans IDE
> Start Page with "Welcome to NetBeans IDE" page and my script is not
> there...
>
> 2. I found out that I can manually run
>
> /Applications/NetBeans/NetBeans 6.8.app/Contents/MacOS/netbeans
> myscript.js
>
> and it opens up myscript.js in Netbeans just fine. Aha! I went to
> about:config and changed greasemonkey.editor to /Applications/NetBeans/
> NetBeans 6.8.app/Contents/MacOS/netbeans, but GM is going back to
> "Please select your preferred text editor first" dialog box when I
> tried to edit my script...
>
> 3. Ok, I've created netbeansh.sh file in my ~/bin directory like that:
>
> #!/bin/sh
>
> /Applications/NetBeans/NetBeans\ 6.8.app/Contents/MacOS/netbeans $*
>
> added executable permission for everyone and tried to select it in GM
> editor selection dialog box, but it didn't take it, telling me
>
> [JavaScript Application] Please pick an executable application to use
> to edit user scripts.
>
> Nothing works. What to do?

Ok, I've just figured it out.

Here is my script:

#!/bin/sh

echo === ENV ===
env
echo === Arguments ===
echo $*
/Applications/NetBeans/NetBeans\ 6.8.app/Contents/MacOS/netbeans "$*"


I've converted it to MacOS application using wonderful little Platypus
tool and it is working now! It looks like GM does not just pass JS
file as an argument to the editor, it uses some sort of messaging
protocol (like in drag-n-drop) and Platypus 4.0 converts those
messages into standard arguments for the script.

Here is the link to Platypus:

http://www.sveinbjorn.org/platypus

Please note that the latest 4.2 version didn't work, has to use older
4.0 version.

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to