can anyone help?
Current code:
Code: Select all
on substitute(card)
set theResult to {"http://gatherer.wizards.com/gathererlookup.asp?name=" & encodept1(card) & "&x=0&y=0"}
tell application "Adium"
display dialog theResult buttons {"Cancel", "Ok"}
end tell
set theLink to "<a href='" & theResult & "'>" & card & "</a>"
tell application "Adium"
--send this message theLink
end tell
return theLink
end substitute
on encodept1(str)
set encoded to ""
repeat with i in str
set j to i as text
set encoded to {encoded & encode(j)}
end repeat
return encoded
end encodept1
on encode(chara)
if chara = " " then
return "%20"
end if
if chara = "'" then
return "%27"
end if
if chara ? " " and chara ? "'" then
return chara
end if
end encode
--testing...
substitute("fghe gfio'ijf")
--encode("fghe gfio'ijf")