How do I set the number of copies for printing in macuby?

104 Views Asked by At

I need to make a small change to a function in a macruby project. In particular I need to print 2 copies of a document, instead of one.

I'm a complete macruby (and objective C/cocoa) noob and have no idea how to do this.

I have a print_settings variable via print_settings = NSPrintInfo.alloc.init, and I need to set the NSPrintCopies key to have a value of 2. How do I do this?!

In objective C, I think the relevant code is:

print_settings_dict = (NSMutableDictionary*)[print_settings dictionary];
[print_settings_dict setObject:[NSNumber numberWithInt:1] forKey:NSPrintCopies];

How do I do this in macruby?

Thanks

1

There are 1 best solutions below

0
On

Figured it out:

print_settings.dictionary.setValue(2, forKey:NSPrintCopies)