Last active
August 29, 2015 14:16
-
-
Save Koze/b50d187fed615772b974 to your computer and use it in GitHub Desktop.
JavaScript for Automation Objective-C bridge Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ObjC.import('Cocoa') | |
//var array = $.NSArray.arrayWithObjects($('jp'), $('us'), $('es'), $('ru')); | |
var array = $(['jp', 'us', 'es', 'ru']); | |
for (var i=0; i<array.count; i++) { | |
var string = array.objectAtIndex(i); | |
var URLString = $.NSString.stringWithFormat('http://store.apple.com/%@/product/MB110CH/B/', string); | |
var URL = $.NSURL.URLWithString(URLString) | |
$.NSWorkspace.sharedWorkspace.openURL(URL) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment