Page 1 of 1
My RSS Newsreader script stopped working (Tiger?)
Posted: Wed Jul 27, 2005 2:35 am
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.
Posted: Wed Jul 27, 2005 9:48 pm
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.
Posted: Wed Jul 27, 2005 11:05 pm
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?
Posted: Thu Jul 28, 2005 1:10 am
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ā¦
Posted: Thu Jul 28, 2005 4:25 am
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.
Posted: Thu Jul 28, 2005 6:03 am
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.
Posted: Thu Jul 28, 2005 4:24 pm
by evands
Use
Code: Select all
path to application support folder from user domain as string
to get the application suport folder.
Posted: Thu Jul 28, 2005 5:02 pm
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".
Posted: Thu Jul 28, 2005 5:22 pm
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)
Posted: Thu Jul 28, 2005 5:45 pm
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!
