[MacRuby-devel] MacRuby scripting bridge speed

Stephen Horne fatste at gmail.com
Fri Dec 23 04:56:39 PST 2011


I've filed a bug under Bug ID# 10623540

https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/15/wo/EhDys34ihfZfRTfpGeDIi0/10.66

Fb

> Joshua Ballanco <mailto:jballanc at gmail.com>
> 23 December 2011 07:10
> If it is ScriptingBridge that is slowing things down, then this sounds 
> like perfect fodder for a bug report to Apple.
>
> - Josh
>
> On Thursday, December 22, 2011 at 12:15 PM, Alan Skipp wrote:
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> Alan Skipp <mailto:al_skipp at fastmail.fm>
> 22 December 2011 17:15
>
>
> I can confirm the same problem with setting up a scripting bridge link 
> to InDesign. In my experience rb-appscript is far superior to 
> scripting bridge, it's a shame it can no longer be developed. 
> Explained here:
>
> http://appscript.sourceforge.net/status.html
>
> I've never attempted to use macruby-appscript, but it might be worth 
> trying?
>
> https://github.com/dnagir/appscript/tree/master/macruby-appscript/trunk
>
> Al
>
> Stephen Horne <mailto:fatste at gmail.com>
> 16 December 2011 15:17
> I'm new to all this, so apologies if I'm doing something daft.
>
> I'm trying to create a MacRuby GUI application to parse a load of 
> information from InDesign documents.
>
> I've previously made this application using applescriptObjC, but I was 
> constantly bouncing off the walls of applescript and getting seemingly 
> random bad_exec errors if I ran it too many times without a reboot, so 
> I've decided to try with MacRuby.
>
> I'm only at the stage of probing MacRuby to see how to do it, and I've 
> immediately hit a problem; it seems to take a very long time to set up 
> the link to InDesign.
>
> I found some code in correspondence between Matt Aimonetti and Spencer 
> Rose that I am using to test:
>
>
>
> #!/usr/local/bin/macruby
> framework 'Foundation'
> framework 'ScriptingBridge'
>
> # I followed Matt's instructions for making the bridge support file, 
> but I wasn't sure where it needs to go, so I did this for a quick fix.
> load_bridge_support_file '/Users/fatboy/inDesign.bridgesupport'
>
> appurl = NSURL.fileURLWithPath("/Applications/Adobe Indesign CS5/Adobe 
> InDesign CS5.app")
> @id = SBApplication.applicationWithURL(appurl)
> doc = @id.activeDocument
>
> puts doc.name
>
> pgph = doc.allParagraphStyles
>
> pgph.each do |style|
>      puts "#{style.name}"
>      puts style.properties["appliedFont"].name
> end
>
>
>
> This code works, but it takes 15+ seconds to set up the link to 
> InDesign (similar stuff with safari takes about 1 second, and in 
> applescript or rb-appscript it takes about a tenth of a second for 
> either InDesign or safari).
>
> I also tried 
> SBApplication.applicationWithBundleIdentifier("com.adobe.indesign"), 
> and this was just the same.
>
> Is there something I am missing here?
>
> Thanks in advance for any help you can offer.
>
> Fb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111223/877bfca7/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1000 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111223/877bfca7/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111223/877bfca7/attachment-0003.jpg>


More information about the MacRuby-devel mailing list