1

Is there a faster way to load scripting bridge applications from MacRuby?

When I make the SBApplication object for Adobe InDesign it takes more than 10 seconds to load. Here's the code I've been using:

framework 'ScriptingBridge'

indesign = SBApplication.applicationWithBundleIdentifier("com.adobe.InDesign")

puts indesign

Of course the generated header file is huge for InDesign... Is there a way to force the use of a support file?

Josh Voigts
  • 4,114
  • 1
  • 18
  • 43
  • This seems like a duplicate of http://stackoverflow.com/questions/8830436/is-it-possible-to-reduce-the-startup-time-of-macruby-scripts-which-use-the-scrip – Jake Mar 10 '12 at 20:40

1 Answers1

0

The large load time when using ScriptingBridge is a documented issue. An alternative is macruby-appscript.

jtomschroeder
  • 1,034
  • 7
  • 11
  • Is there any way to load a support file or the headers before hand? – Josh Voigts Feb 18 '12 at 03:34
  • I'm not sure what you mean by before hand. The files will have to be loaded at some point. – jtomschroeder Feb 19 '12 at 07:07
  • Before the script is run. I'm assuming each time it is run, the scripting bridge is generating whatever files it needs to communicate with the application. The time consuming part of the "loading" is either the generating or just getting it into memory? If you could generate them before hand it might load faster? – Josh Voigts Feb 20 '12 at 00:38
  • Have a look at `gen_bridge_metadata`. I've used it for frameworks, but it should also work for a set of headers. – jtomschroeder Feb 20 '12 at 01:38
  • Appscript is effectively deprecated, so this isn't really a viable option. – Jake Mar 10 '12 at 20:39