Re: [MacRuby-devel] Using scripting bridge to create new objects within a Cocoa App.

2012-10-28 Thread Kam Dahlin
ScriptingBridge offers a couple of ways of creating objects. One is to use the generated classes and then just alloc/-init or -initWithProperties to create an object of that class type. The other is to use -classForScriptingClass on SBApplication to get the scripting class you want to create an

Re: [MacRuby-devel] MacRuby, ApplesScript and Skype?

2012-05-30 Thread Kam Dahlin
You could try generating the Skype Scripting Bridge header. That will at least give you better documentation on what Skype's SB API looks like. Take a look here: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/UsingScriptingBri

Re: [MacRuby-devel] rubyfying Cocoa iterators

2011-11-17 Thread Kam Dahlin
If you didn't want to use a category, you could do: orderedSet = NSOrderedSet.orderedSetWithArray(["1", "2", "3"]) orderedSet.class.send(:define_method, :each) do self.array.each do |item| yield item end end orderedSet.each do |item| puts item end This method also has the advant

Re: [MacRuby-devel] Scripting OmniGraffle

2011-11-15 Thread Kam Dahlin
Hi Sophie, Here is a little example, that I hope makes things more clear. graffle = SBApplication.applicationWithBundleIdentifier("com.omnigroup.OmniGrafflePro") win = graffle.windows.first canvas = win.canvas circle = OmniGraffleProfessionalShape.alloc.initWithProperties({:name=>"Circle", :

Re: [MacRuby-devel] MacRuby-devel Digest, Vol 45, Issue 20

2011-11-14 Thread Kam Dahlin
You will need to create a shape object and then add it to the correct container. something like: shape = OmniGraffleShape.alloc.init canvas.shapes.addObject shape The different shape classes can be views by generating the OmniGraffle scriptingbridge header with: sdef /Path/To/OmniGraffle.app |

Re: [MacRuby-devel] NSTrackingArea

2011-04-27 Thread Kam Dahlin
t;> Thomas, >> >> Are you still getting an undefined method error, or something new? Do you >> have a "framework 'Cocoa'" line somewhere in your app? >> >> - Josh >> >> On Wed, Apr 27, 2011 at 12:10 PM, Thomas R. Koll wrote: &g

Re: [MacRuby-devel] NSTrackingArea

2011-04-27 Thread Kam Dahlin
Hi, http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSTrackingArea_class/Reference/Reference.html Looks like the initializer is: – initWithRect:options:owner:userInfo: Try something like: tc = NSTrackingArea.alloc.initWithRect(self.bounds, options:(NSTrackingMouseEntered