My RSS Newsreader script stopped working (Tiger?)

An instant messenger which can connect to AIM, GTalk, Jabber, ICQ, and more.
Post Reply
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

My RSS Newsreader script stopped working (Tiger?)

Post by noleli »

So I finally upgraded to Tiger, and everything's been smooth except now my RSS News Headlines script doesn't seem to be working. It does that thing where you type the keyword (%_rss), and it just thinks it's typing forever, but never sends anything.

What's weird is that all of the individual components work: if I open the substitute script in Script Editor and call substitute(), the results that it returns are totally correct; if I comment out the whole thing and just have it return static text, the keyword correctly substitutes it in Adium. Does anyone have any thoughts on why this might be happening? Thanks!

Oh, I'm running r12955, but all other scripts (including those that return links) work fine.
User avatar
zaudragon
Growl Team
Posts: 1852
Joined: Sat Dec 04, 2004 5:05 am
Location: Kensington, CA, USA
Contact:

Post by zaudragon »

Look at the Info.plist. There might be an error there.

And it seems like you have %rss in your Insert Scripts menu, so I guess there is no Case Sensitive problem.
Blog | X(tras)
Communists code without classes.
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

Post by noleli »

The reason I don't think it's a problem with the plist is that if I change the subsitute function to just return a static string of text, it subs into Adium fine.

If Adium gets poorly formed HTML, does is exhibit the behavior I described?
User avatar
zaudragon
Growl Team
Posts: 1852
Joined: Sat Dec 04, 2004 5:05 am
Location: Kensington, CA, USA
Contact:

Post by zaudragon »

noleli wrote:The reason I don't think it's a problem with the plist is that if I change the subsitute function to just return a static string of text, it subs into Adium fine.

If Adium gets poorly formed HTML, does is exhibit the behavior I described?
Eh? Yeah, it stalls and eveytually crashes. Tried it before…
Blog | X(tras)
Communists code without classes.
User avatar
evands
Cocoaforge Admin
Posts: 3152
Joined: Thu Dec 02, 2004 10:55 pm
Location: Decatur, GA
Contact:

Post by evands »

Sounds like an AIHTMLDecoder bug. Can you give example HTML output that makes Adium go *boom*? If you can do it locally, it's also a remote exploit, since a malicious client could send whatever the HTML is and make Adium crash trying to decode it.
The duck still burns.
--
My company: Saltatory Software. Check it out :)
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

Post by noleli »

Actually, it seems like a problem with the fact that "do shell script" always uses sh, and Adium seems to be using a different shell.

Code: Select all

on substitute()
	set HLfile to "$HOME\"/Library/Application Support/Adium 2.0/Scripts/RSS News Headlines.AdiumScripts/Contents/Resources/headline.txt\""
       --headline.txt contains the text of the RSS headline
	
	set URLfile to "$HOME\"/Library/Application Support/Adium 2.0/Scripts/RSS News Headlines.AdiumScripts/Contents/Resources/url.txt\""
	--url.txt contains the url of the RSS article
	
	set theHeadline to do shell script "more " & HLfile
	set theURL to do shell script "more " & URLfile
	
	set theLink to "<HTML><A HREF=\"" & theURL & "\">" & theHeadline & "</A></HTML>"
	return theLink
end substitute
The above code works fine from script editor, but not in Adium. (Adium isn't actually crashing; it will show me as typing indefinitely, or until I send something else.)

If I specify a full path (i.e. not using $HOME), it works in Script Editor and Adium. This seems to be a change in Tiger.
User avatar
evands
Cocoaforge Admin
Posts: 3152
Joined: Thu Dec 02, 2004 10:55 pm
Location: Decatur, GA
Contact:

Post by evands »

Use

Code: Select all

path to application support folder from user domain as string
to get the application suport folder.
The duck still burns.
--
My company: Saltatory Software. Check it out :)
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

Post by noleli »

Sweet! Thanks. Is there any way I can use that to return the Unix path instead of the old-school MacOS path with the colons? I'm using it in a "do shell script".
User avatar
zaudragon
Growl Team
Posts: 1852
Joined: Sat Dec 04, 2004 5:05 am
Location: Kensington, CA, USA
Contact:

Post by zaudragon »

noleli wrote:Sweet! Thanks. Is there any way I can use that to return the Unix path instead of the old-school MacOS path with the colons? I'm using it in a "do shell script".

Code: Select all

POSIX path of (path to application support folder from user domain as string)
Blog | X(tras)
Communists code without classes.
User avatar
noleli
Latté
Posts: 80
Joined: Sun Dec 19, 2004 7:14 pm
Location: UMich

Post by noleli »

I thought it had something to do with that POSIX thing. I'd seen that before, but never really bothered to read up on it. Thanks!

I got it working! :D
Post Reply