Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: c080014c15
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (17 sloc) 0.727 kb
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 date = new Date();
var folderName = date.getFullYear() + "." + date.getMonth() + "." + date.getDate();
print(folderName);
var finalPath = path + '/' + folderName;
[[NSFileManager defaultManager] createDirectoryAtPath: finalPath attributes:nil];
}
else {
print("There's no window open")
}
Jump to Line
Something went wrong with that request. Please try again.