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
this is a test |
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
<key>com.apple.security.temporary-exception.apple-events</key> | |
<array> | |
<string>com.apple.mail</string> | |
</array> |
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
#import "AppDelegate.h" | |
@implementation AppDelegate | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
NSDictionary *error = nil; | |
NSString *source = @"tell application \"Finder\"\ntry\nset dir to the target of the front window\nreturn POSIX path of (dir as text)\non error\nreturn \"/\"\nend try\nend tell"; | |
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source]; | |
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
/* | |
* MethodSwizzle.h | |
* | |
* Copyright (c) 2007-2011 Kent Sutherland | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of | |
* this software and associated documentation files (the "Software"), to deal in | |
* the Software without restriction, including without limitation the rights to use, | |
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the | |
* Software, and to permit persons to whom the Software is furnished to do so, |
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
NSScreen *mainScreen = [NSScreen mainScreen]; | |
NSURL *imgURL = [[NSWorkspace sharedWorkspace] desktopImageURLForScreen:mainScreen]; |
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
NSMutableString *reversedString = [NSMutableString string]; | |
NSInteger charIndex = [myString length]; | |
while (charIndex > 0) { | |
charIndex--; | |
NSRange subStrRange = NSMakeRange(charIndex, 1); | |
[reversedString appendString:[myString substringWithRange:subStrRange]]; | |
} | |
NSLog(@"%@", reversedString); |