mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Initial commit
This commit is contained in:
18
Applications/TextMate/src/GetURLScriptCommand.mm
Normal file
18
Applications/TextMate/src/GetURLScriptCommand.mm
Normal file
@@ -0,0 +1,18 @@
|
||||
#import <document/collection.h>
|
||||
#import <oak/CocoaSTL.h>
|
||||
#import <OakFoundation/NSArray Additions.h>
|
||||
#import <io/path.h>
|
||||
|
||||
@interface GetURLScriptCommand : NSScriptCommand
|
||||
@end
|
||||
|
||||
@implementation GetURLScriptCommand
|
||||
- (id)performDefaultImplementation
|
||||
{
|
||||
NSString* urlString = [self directParameter];
|
||||
if([urlString hasPrefix:@"txmt:"] && ![urlString hasPrefix:@"txmt://"])
|
||||
urlString = [@"txmt://" stringByAppendingString:[urlString substringFromIndex:5]];
|
||||
[NSApp sendAction:@selector(handleTxMtURL:) to:nil from:[NSURL URLWithString:urlString]];
|
||||
return nil;
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user