von heiglandreas » 11 Aug 2008, 22:29
Mit diesem Patch hab ich das Growl-Plugin dann zum laufen bekommen.
Code: Alles auswählen
Index: /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java
===================================================================
--- /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java (revision 4903)
+++ /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java (working copy)
@@ -1,6 +1,6 @@
/*
* GrowlPlugin by Bodo Tasche
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -36,9 +36,9 @@
/**
* This is the Container-Class for Growl
- *
+ *
* It uses AppleScript to call Growl.
- *
+ *
* @author bodum
*
*/
@@ -48,7 +48,7 @@
/** Parser for Text */
private ParamParser mParser;
-
+
/**
* Create the Growl-Container
*/
@@ -55,10 +55,10 @@
public GrowlContainer() {
mParser = new ParamParser();
}
-
+
/**
* Notifies Growl
- *
+ *
* @param settings Settings to use
* @param prg Program to use
*/
@@ -66,26 +66,17 @@
String title = mParser.analyse(settings.getProperty("title"), prg);
String desc = mParser.analyse(settings.getProperty("description"), prg);
AppleScriptRunner runner = new AppleScriptRunner();
+ String script = "tell application \"GrowlHelperApp\"\n"+
+ " set the allNotificationsList to {\"TVBrowserSendProgram\"}\n"+
+ " register as application \"TV-Browser\" all notifications allNotificationsList default notifications allNotificationsList icon of application \"TV-Browser\"\n"+
+ " notify with name \"TVBrowserSendProgram\" title \""+runner.formatTextAsParam(title)+"\" description \""+runner.formatTextAsParam(desc) + "\" application name \"TV-Browser\"\n"+
+ "end tell";
try {
- runner.executeScript("tell application \"GrowlHelperApp\"\n" +
- "\tset the allNotificationsList to {\"TVBrowserSendProgram\"}\n" +
- "\t\n" +
- "\tregister as application ¨\n" +
- "\t\t\"TV-Browser\" all notifications allNotificationsList ¨\n" +
- "\t\tdefault notifications allNotificationsList ¨\n" +
- "\t\ticon of application \"TV-Browser\"\n" +
- "\t\n" +
- "\t--\tSend a Notification...\n" +
- "\tnotify with name ¨\n" +
- "\t\t\"TVBrowserSendProgram\" title ¨\n" +
- "\t\t\""+ runner.formatTextAsParam(title) +"\" description ¨\n" +
- "\t\t\""+ runner.formatTextAsParam(desc) + "\" application name \"TV-Browser\"\n" +
- "\t\n" +
- "end tell");
+ runner.executeScript(script);
} catch (IOException e) {
- mLog.log(Level.SEVERE, "Can't execute AppleScript", e);
+ mLog.log(Level.SEVERE, "Can't execute AppleScript\n\n" + script, e);
}
}
-
+
}
\ No newline at end of file
Grüße
Andreas
Mit diesem Patch hab ich das Growl-Plugin dann zum laufen bekommen.
[code]Index: /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java
===================================================================
--- /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java (revision 4903)
+++ /Volumes/Daten/Users/heiglandreaspb/Development/tvbrowser/src/growlplugin/GrowlContainer.java (working copy)
@@ -1,6 +1,6 @@
/*
* GrowlPlugin by Bodo Tasche
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@@ -36,9 +36,9 @@
/**
* This is the Container-Class for Growl
- *
+ *
* It uses AppleScript to call Growl.
- *
+ *
* @author bodum
*
*/
@@ -48,7 +48,7 @@
/** Parser for Text */
private ParamParser mParser;
-
+
/**
* Create the Growl-Container
*/
@@ -55,10 +55,10 @@
public GrowlContainer() {
mParser = new ParamParser();
}
-
+
/**
* Notifies Growl
- *
+ *
* @param settings Settings to use
* @param prg Program to use
*/
@@ -66,26 +66,17 @@
String title = mParser.analyse(settings.getProperty("title"), prg);
String desc = mParser.analyse(settings.getProperty("description"), prg);
AppleScriptRunner runner = new AppleScriptRunner();
+ String script = "tell application \"GrowlHelperApp\"\n"+
+ " set the allNotificationsList to {\"TVBrowserSendProgram\"}\n"+
+ " register as application \"TV-Browser\" all notifications allNotificationsList default notifications allNotificationsList icon of application \"TV-Browser\"\n"+
+ " notify with name \"TVBrowserSendProgram\" title \""+runner.formatTextAsParam(title)+"\" description \""+runner.formatTextAsParam(desc) + "\" application name \"TV-Browser\"\n"+
+ "end tell";
try {
- runner.executeScript("tell application \"GrowlHelperApp\"\n" +
- "\tset the allNotificationsList to {\"TVBrowserSendProgram\"}\n" +
- "\t\n" +
- "\tregister as application ¨\n" +
- "\t\t\"TV-Browser\" all notifications allNotificationsList ¨\n" +
- "\t\tdefault notifications allNotificationsList ¨\n" +
- "\t\ticon of application \"TV-Browser\"\n" +
- "\t\n" +
- "\t--\tSend a Notification...\n" +
- "\tnotify with name ¨\n" +
- "\t\t\"TVBrowserSendProgram\" title ¨\n" +
- "\t\t\""+ runner.formatTextAsParam(title) +"\" description ¨\n" +
- "\t\t\""+ runner.formatTextAsParam(desc) + "\" application name \"TV-Browser\"\n" +
- "\t\n" +
- "end tell");
+ runner.executeScript(script);
} catch (IOException e) {
- mLog.log(Level.SEVERE, "Can't execute AppleScript", e);
+ mLog.log(Level.SEVERE, "Can't execute AppleScript\n\n" + script, e);
}
}
-
+
}
\ No newline at end of file[/code]
Grüße
Andreas