adium 4493:bb71775097bf: Make sure AdiumApplescriptRunner can st...

commits at adium.im commits at adium.im
Wed Jan 11 18:14:23 UTC 2012


details:	http://hg.adium.im/adium/rev/bb71775097bf
revision:	4493:bb71775097bf
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Wed Jan 11 19:14:11 2012 +0100

Make sure AdiumApplescriptRunner can still be started from within Adium, this broke in 5d52dabbebe4.

LSOpenFromRefSpec adds a argument like -psn_0_1234, which got interpreted as the path of a script.

diffs (14 lines):

diff -r c3f51cbb02e0 -r bb71775097bf Source/ApplescriptRunner.m
--- a/Source/ApplescriptRunner.m	Wed Jan 11 18:29:29 2012 +0100
+++ b/Source/ApplescriptRunner.m	Wed Jan 11 19:14:11 2012 +0100
@@ -234,7 +234,9 @@
 		(void)[processArgumentsEnum nextObject]; //The first argument is the command name. We don't need that.
 
 		scriptPath = [processArgumentsEnum nextObject];
-		if (!scriptPath) {
+		
+		// It appears LSOpenFromRefSpec passes something of the form -psn_0_1234, don't interpret that as the path of a script.
+		if (!scriptPath || [scriptPath hasPrefix:@"-psn_"]) {
 			[applescriptRunner beginObservingForDistributedNotifications];
 
 			//Run in the background for up to SECONDS_INACTIVITY_BEFORE_AUTOMATIC_QUIT seconds, waiting for Adium to give us a script to run.




More information about the commits mailing list