Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 25 lines (17 sloc) 0.727 kB
dd4a5cd @ccgus [UPDATE] The AcornNewImageWithCurvedDropShadow now uses full objc syntax
authored
1 var windows = [[SBApplication application:"Finder"] windows];
2
3 if ([windows count] > 0) {
4
5 // from SBObject:
6 // get() "Forces evaluation of the receiver, causing the real object to be returned immediately."
7 var win = windows[0].get();
8 var target = win.target().get();
9 var url = [NSURL URLWithString:[target URL]];
10 var path = [url path].replace("%20", " ");
11
12 var date = new Date();
13
14 var folderName = date.getFullYear() + "." + date.getMonth() + "." + date.getDate();
15
16 print(folderName);
17
18 var finalPath = path + '/' + folderName;
19
20 [[NSFileManager defaultManager] createDirectoryAtPath: finalPath attributes:nil];
21 }
22 else {
23 print("There's no window open")
24 }
Something went wrong with that request. Please try again.