Skip to content

Instantly share code, notes, and snippets.

@atr000
Created December 16, 2010 21:01
Show Gist options
  • Save atr000/744007 to your computer and use it in GitHub Desktop.
Save atr000/744007 to your computer and use it in GitHub Desktop.
cleanupd desktop files
#import <Foundation/Foundation.h>
int main(int argc, const char* argv[])
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSAppleScript* script = [[NSAppleScript alloc] initWithSource:@"tell application \"Finder\"\nclean up window of desktop\nend tell"];
while ( true )
{
NSAutoreleasePool* pool2 = [[NSAutoreleasePool alloc] init];
[script executeAndReturnError:nil];
sleep(30);
[pool2 release];
}
[pool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment