Snak, AppleScript, and Me: A Tale of Failure

The Growl forums have moved to Google Groups, this forum is read only.
ja2ke
Harmless
Posts: 3
Joined: Mon Apr 04, 2005 5:23 am

Snak, AppleScript, and Me: A Tale of Failure

Postby ja2ke » Mon Apr 04, 2005 5:38 am

Hi there, sorry for my absolute noobness to both AppleScript and Growl, but I have nowhere else to turn :) I just got Growl earlier today and am loving it. I noticed there was a script for Snak included on the Growl disk image, though it had no instructions. I have failed utterly to get it to work, and would love it if someone could point me in the right direction, but first I guess I should outline my tale of woe:

I looked at the included Snak script, and added to the keyword notifier area of the script a couple of keywords I thought I might want to be notified about. Ok cool, so far so good.

Now I wondered how to get Snak to pay attention to it (I've never actually used an AppleScript with Snak, be it the bundled scripts or user installed, never touched it :)). Simply drop it in Snak's "Scripts" folder? Hm, no. Is there a Scripts menu in the app itself? Er not there either I guess.

So, I finally RTFM and discovered I was supposed to drop it in Snak's "Scripts" folder and then type /load [script name] in the Snak command line. Piece of cake. So I /load Growl.scpt and (hooray!!) GrowlSnak appears in my Growl apps list!

Now maybe I'll try receiving a /msg... or typing a line of text that includes my nick or one of the keywords I included in the script. You know, to see if I could actually see a Snak Growl notification in action. This is where it all came crashing down. If I tried any of the above things (getting /msg'd, receiving a line of text with my own nick or with one of the other keywords I specified), Snak would just churn out the error

Code: Select all

Info: A script error occurred when trying to call the privmsg event handler


:cry:

No degree of fiddling around has fixed it. I did once manage to make it horribly worse, splattering my chat window with a stream of pure evil which somewhat resembled...

Code: Select all

10:10:***: FASDUAS Unknown command
10:10:***: ˇ˚ Unknown command
10:10:***: ˇ˘ Unknown command
10:10:***: ˇ¯ Unknown command
10:10:***: ANOT Unknown command
10:10:***: ˇˆ Unknown command
10:10:***: DNOT Unknown command
10:10:***: ˇÙ Unknown command
10:10:***: IAPP Unknown command
10:10:***: ¡: GROWLHELPERAPP.APP≥®ê Unknown command
10:10:***: MGROWLHELPERAPP.APP Unknown command

After deleting my mangled version of the script and reverting to a clean one from the Growl DMG it's not doing that anymore at least, but is still returning the "script error occurred when trying to call the privmsg event handler" error I listed above.

For the record, I did get the Firefox download notification plugin working (which means, I assume, that my attempt to install growlnotify on my machine was successful). I've got no clue at all if that is necessary to get the Snak script to work, but I figured I might as well point that out ahead of time just in case the first response to my obvious newb problem is "Have you installed growlnotify?" Like, if that's the "rebuild the desktop" of the Growl world, I want to have my bases covered... or at least that one base. A base.

Anyway, thanks for the help if you guys can provide it (from the other posts in here you seem a friendly bunch), and please excuse my sorry ramblings. Daylight Savings Time has ruined me.

User avatar
Diggory
Growl Team
Posts: 129
Joined: Sat Dec 04, 2004 12:17 pm
Location: London

Postby Diggory » Mon Apr 04, 2005 6:11 pm

Hmm - sorry about that - the Snak script was out of date.

You can get an up to date version here:

http://trac.growl.info/trac/file/branch ... Growl.scpt

ja2ke
Harmless
Posts: 3
Joined: Mon Apr 04, 2005 5:23 am

Postby ja2ke » Mon Apr 04, 2005 7:38 pm

I'm having the same troubles with that version too, actually (well, I still get the privmsg error if I run the script and then receive a /msg or a line comes through with my nick in it, but now Snak isn't showing up as a registered application in Growl even after I run the script). :( Thanks for the help though!

User avatar
The_Tick
Cocoaforge Admin
Posts: 4642
Joined: Thu Dec 02, 2004 6:06 am
Contact:

Postby The_Tick » Mon Apr 04, 2005 8:05 pm

Are you using the latest version of Snak, the latest version of os x, and the latest version of Growl?

ja2ke
Harmless
Posts: 3
Joined: Mon Apr 04, 2005 5:23 am

Postby ja2ke » Mon Apr 04, 2005 8:31 pm

Yes (as far as I know), yes (as far as I know), and yes (as far as I know). Well, latest release versions at least. I'm using the most recent version of Growl available from the main page. No self-compiled stuff or development releases or anything of any of those.

I am predicting that the bug I'm encountering is that I'm incompetent, though. ¬ ¬

:)

User avatar
Diggory
Growl Team
Posts: 129
Joined: Sat Dec 04, 2004 12:17 pm
Location: London

Postby Diggory » Mon Apr 04, 2005 9:34 pm

Hmm - not sure what happened there - I think a missing newline.

Try downloading again (from the same link as above.)

Gadall
Harmless
Posts: 2
Joined: Tue May 10, 2005 9:29 pm

Growl + Snak 5.0

Postby Gadall » Tue May 10, 2005 9:31 pm

Any chance of getting a working script to enable Growl notifications in Snak 5.0?

the current script produces:
4:22:12<Error> Unexpected end of file growl.scpt
4:22:12*** FASDUAS Unknown command
4:22:12*** REGISTERGROWL Unknown command
4:22:12*** REGISTERGROWL?? Unknown command
4:22:12*** ?¯ Unknown command
4:22:12*** ?ˆ Unknown command
4:22:15*** ?? Unknown command
4:22:17*** ANOT Unknown command
4:22:19*** ?Û Unknown command
4:22:21*** DNOT Unknown command
4:22:23*** ?Ò Unknown command
4:22:25*** IAPP Unknown command
...

User avatar
Diggory
Growl Team
Posts: 129
Joined: Sat Dec 04, 2004 12:17 pm
Location: London

Postby Diggory » Wed May 11, 2005 11:30 am

Hmm - odd, i tried the script with Snak V5 - the first time, it failed, much like your quote above.

I then quit Snak, looked inside the script and tried again, and it seemed to work fine.

Try opening the script with script editor, and resaving it.

Gadall
Harmless
Posts: 2
Joined: Tue May 10, 2005 9:29 pm

Postby Gadall » Wed May 11, 2005 2:17 pm

I tried this. I no longer get an error (or any message for that matter). I also don't see Snak as one of the registered applications in Growl's Preferences Pane.

UPDATE: It does now show in Growl's Preference Pane, and appears to work with one slight bug. If Snak has focus, I receive the following error when ever I receive a private message:
10:46:59<Info> A script error occurred when trying to call the privmsg event handler

pixagen
Harmless
Posts: 1
Joined: Mon May 16, 2005 12:32 am

Postby pixagen » Mon May 16, 2005 1:56 am

Gadall wrote:If Snak has focus, I receive the following error when ever I receive a private message:
10:46:59<Info> A script error occurred when trying to call the privmsg event handler


i've been getting this, too. i've been tweaking to see how i can fix it, but seeing as i am just learning how to script i haven't had much luck...

disco
Harmless
Posts: 1
Joined: Tue Oct 11, 2005 5:00 pm

Postby disco » Tue Oct 11, 2005 5:27 pm

pixagen wrote:
Gadall wrote:If Snak has focus, I receive the following error when ever I receive a private message:
10:46:59<Info> A script error occurred when trying to call the privmsg event handler


i've been getting this, too. i've been tweaking to see how i can fix it, but seeing as i am just learning how to script i haven't had much luck...


I had this problem too, turns out to be a simple code error.

Detailed answer: The privmsg() event handler was looking to see whether Snak was the frontmost app, or whether the NotifyInBackgroundOnly variable was set to false. Problem was that this variable was being set within the pubmsg() event handler, and was therefore not available to the privmsg() handler, hence the error. I thought that it might be handy to be able to configure NotifyInBackgroundOnly separately for both pubmsg() and privmsg(), so I added it to the privmsg() handler code. If you prefer to set it once and save a couple of lines of code, you can certainly just move it outside of the pubmsg() handler.

Short answer: Add the following lines to the code immediately following the on privmsg(con, source, sourcehost, target, thestring) line

Code: Select all

   -- Set to false to popup notifications even when snak is the active application
   set NotifyInBackgroundOnly to true


Return to “Growl”

Who is online

Users browsing this forum: No registered users