Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (15 sloc) 585 Bytes
var windows = SBApplication.application_("Finder").windows();
if (windows.count() > 0) {
// from SBObject:
// get() "Forces evaluation of the receiver, causing the real object to be returned immediately."
var win = windows[0].get();
var target = win.target().get();
var url = NSURL.URLWithString_(target.URL());
var path = url.path().replace("%20", " ");
var terminal = SBApplication.application_("Terminal");
terminal.activate();
terminal.doScript_in_("cd '" + path + "'", nil);
}
else {
print("There's no window open")
}
Jump to Line
Something went wrong with that request. Please try again.