MacRuby and Scripting Bridge
Hi all, As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use. Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript: * app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)* to Scripting Bridge? *appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl)* app.dosamething It wont accept app.scripting_preferences or app.scriptpreferences? Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome! Thanks in advance -- Nimitz
Have you tried the macruby version of rb-appscript? I found it ran most of scripts without any change. I was also initially attracted to scripting bridge but had problems with it and subsequently read a few negative reports. On 30 Sep 2011, at 13:08, Naughty Nimitz <naughty.nimitz@gmail.com> wrote:
Hi all,
As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use.
Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript:
app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)
to Scripting Bridge? appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl) app.dosamething
It wont accept app.scripting_preferences or app.scriptpreferences?
Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome!
Thanks in advance
-- Nimitz
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
app.objc_methods should reveal the methods it's inherited thanks to Scripting Bridge. Greg On Sep 30, 2011, at 5:08 AM, Naughty Nimitz wrote:
Hi all,
As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use.
Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript:
app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)
to Scripting Bridge? appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl) app.dosamething
It wont accept app.scripting_preferences or app.scriptpreferences?
Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome!
Thanks in advance
-- Nimitz
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi Greg, that doesn't work alas... but I googled your solution and found that app.methods(true,true) did work. No idea what the two parameters are for. Thx for the lead Nimitz 2011/9/30 Gregory Clarke <greg@intelligentassistance.com>
app.objc_methods should reveal the methods it's inherited thanks to Scripting Bridge.
Greg
On Sep 30, 2011, at 5:08 AM, Naughty Nimitz wrote:
Hi all,
As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use.
Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript: * app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)*
to Scripting Bridge? *appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl)* app.dosamething
It wont accept app.scripting_preferences or app.scriptpreferences?
Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome!
Thanks in advance
-- Nimitz
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
-- This signature is patented.
The plot thickens... (thanks to object.methods(true,true) the alternative is now: app.scriptPreferences.setUserInteractionLevel(somethingsomething) What that somethingsomething should be , i have no idea yet app.scriptPreferences.userInteractionLevel gives me 1699311169 Is there a way to get program constants? So i can interpret them and pass them to methods? Nimitz
On Sep 30, 2011, at 5:08 AM, Naughty Nimitz wrote:
Hi all,
As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use.
Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript: * app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)*
to Scripting Bridge? *appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl)* app.dosamething
It wont accept app.scripting_preferences or app.scriptpreferences?
Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome!
Thanks in advance
-- Nimitz
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
-- This signature is patented.
-- This signature is patented.
methods(true, true) means show Ruby methods as well as Objective-C methods. - Matt On Fri, Sep 30, 2011 at 7:04 PM, Naughty Nimitz <naughty.nimitz@gmail.com>wrote:
Hi Greg,
that doesn't work alas... but I googled your solution and found that app.methods(true,true) did work.
No idea what the two parameters are for.
Thx for the lead
Nimitz
2011/9/30 Gregory Clarke <greg@intelligentassistance.com>
app.objc_methods should reveal the methods it's inherited thanks to Scripting Bridge.
Greg
On Sep 30, 2011, at 5:08 AM, Naughty Nimitz wrote:
Hi all,
As i am migrating from RubyCocoa (and the rb-appscript gem) to MacRuby I am charmed by Scripting Bridge: no gems required and supposedly easy to use.
Now my problem is how to migrate some statements: take this one in RubyCocoa and appscript: * app("Adobe Indesign CS5").script_preferences.user_interaction_level.set(:never_interact)*
to Scripting Bridge? *appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe InDesign CS5.app") app = SBApplication.applicationWithURL(appurl)* app.dosamething
It wont accept app.scripting_preferences or app.scriptpreferences?
Alas, app.methods does not reveal a lot of information apart from the default ruby methods. Any clues (blogs, ...) where i can find info are more than welcome!
Thanks in advance
-- Nimitz
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
-- This signature is patented.
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (4)
-
Gregory Clarke
-
Matt Aimonetti
-
Naughty Nimitz
-
Steve Clarke