Skip to content

Commit

Permalink
unlinked scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Takayama Motohiro committed Jul 11, 2009
1 parent da00654 commit 20899c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
8 changes: 5 additions & 3 deletions PushPasteMac/HotkeyHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ OSStatus myHotKeyHandler(EventHandlerCallRef nextHandler, EventRef anEvent, void
GetEventParameter(anEvent,kEventParamDirectObject,typeEventHotKeyID,NULL,sizeof(hkRef),NULL,&hkRef);

switch (hkRef.id) {
case 1:
NSLog(@"Event 1 was triggered!");
// get clipboard text
case 1:
NSLog(@"Event 1 was triggered!");
// get clipboard text
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];

// send to iPhone
break;
case 2:
Expand Down
10 changes: 0 additions & 10 deletions PushPasteMac/PushPasteMac.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@
4DDCA70C0ACC9A6100E082CE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */; };
922CC2480FCD9D62005B2A92 /* daemon.rb in Resources */ = {isa = PBXBuildFile; fileRef = 922CC2470FCD9D62005B2A92 /* daemon.rb */; };
922CC2720FCDA182005B2A92 /* TCallScript.h in Headers */ = {isa = PBXBuildFile; fileRef = 922CC2700FCDA182005B2A92 /* TCallScript.h */; };
922CC2730FCDA182005B2A92 /* TCallScript.m in Sources */ = {isa = PBXBuildFile; fileRef = 922CC2710FCDA182005B2A92 /* TCallScript.m */; };
922CC27E0FCDA69C005B2A92 /* AEDescUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 922CC27C0FCDA69C005B2A92 /* AEDescUtils.h */; };
922CC27F0FCDA69C005B2A92 /* AEDescUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 922CC27D0FCDA69C005B2A92 /* AEDescUtils.m */; };
92654A3C1007926E00D36A70 /* HotkeyHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 92654A3A1007926E00D36A70 /* HotkeyHandler.h */; };
92654A3D1007926E00D36A70 /* HotkeyHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 92654A3B1007926E00D36A70 /* HotkeyHandler.m */; };
92654A51100797E600D36A70 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92654A50100797E600D36A70 /* Carbon.framework */; };
92A140820FCEF7EC00284DAC /* ShortcutHandler.scpt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 922CC2410FCD9C6F005B2A92 /* ShortcutHandler.scpt */; };
B9C63CAF0FD270D0000C04DE /* Icons.icns in Resources */ = {isa = PBXBuildFile; fileRef = B9C63CAE0FD270D0000C04DE /* Icons.icns */; };
B9ECD87F0FD26C05005AF57C /* activated.png in Resources */ = {isa = PBXBuildFile; fileRef = B9ECD87D0FD26C05005AF57C /* activated.png */; };
B9ECD8800FD26C05005AF57C /* deactivated.png in Resources */ = {isa = PBXBuildFile; fileRef = B9ECD87E0FD26C05005AF57C /* deactivated.png */; };
Expand All @@ -34,7 +29,6 @@
dstPath = "";
dstSubfolderSpec = 7;
files = (
92A140820FCEF7EC00284DAC /* ShortcutHandler.scpt in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -179,8 +173,6 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
922CC2720FCDA182005B2A92 /* TCallScript.h in Headers */,
922CC27E0FCDA69C005B2A92 /* AEDescUtils.h in Headers */,
92654A3C1007926E00D36A70 /* HotkeyHandler.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -248,8 +240,6 @@
buildActionMask = 2147483647;
files = (
4DDCA70A0ACC9A6100E082CE /* main.m in Sources */,
922CC2730FCDA182005B2A92 /* TCallScript.m in Sources */,
922CC27F0FCDA69C005B2A92 /* AEDescUtils.m in Sources */,
92654A3D1007926E00D36A70 /* HotkeyHandler.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
13 changes: 8 additions & 5 deletions PushPasteMac/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ def icon_images
end
return @s_icon_images
end

def setup_pasteboard
pb = OSX::NSPasteboard.generalPasteboard
pb.availableTypeFromArray [OSX::NSStringPboardType]
puts pb.stringForType OSX::NSStringPboardType
end

def applicationDidFinishLaunching(notification)
@is_working = true
@window.setReleasedWhenClosed false

OSX::HotkeyHandler::setupHotkey

setup_pasteboard

bar = OSX::NSStatusBar.systemStatusBar
@menu = bar.statusItemWithLength(24).retain
Expand All @@ -73,11 +81,6 @@ def applicationDidFinishLaunching(notification)
@menu.setHighlightMode true
@menu.setMenu @menus

bundle = OSX::NSBundle::mainBundle;
path = bundle.pathForResource_ofType("ShortcutHandler", "scpt")
script_url = OSX::NSURL.alloc.initFileURLWithPath(path)
@tc = OSX::TCallScript.alloc.initWithURLToCompiledScript(script_url)

@net_service = OSX::NSNetService.alloc.initWithDomain_type_name_port('', '_wwdcpic._tcp', '', DAEMON_PORT)
@net_service.setDelegate(self)
@net_service.publish
Expand Down

0 comments on commit 20899c4

Please sign in to comment.