launching twitter App.
Posted: Tue Mar 29, 2016 3:59 pm
Hi All,
Here is my pseudocode for launching Twitter app. if the Twitter app is installed on the android device, the handler launches Twitter app to post message. but if there is no Twitter app installed on the device, the handler launches the web page instead. My code below is not working.. have any idea to make it work? It will be very appreciated if anyone advice me..
Thanks a lot in advance!
Louis
Here is my pseudocode for launching Twitter app. if the Twitter app is installed on the android device, the handler launches Twitter app to post message. but if there is no Twitter app installed on the device, the handler launches the web page instead. My code below is not working.. have any idea to make it work? It will be very appreciated if anyone advice me..

Code: Select all
on postOnTwitter
local tURL, pBody
put url "twitter://post?message=" into tURL ##url of twitter app
if tURL is empty then ## if there is no Twitter app installed.
put "This is my message!" into pBody
launch url "http://www.twitter.com/intent/tweet?text=" & urlEncode(pBody)
else ## if there is Twitter app installed.
launch url "twitter://post?message=This is my message!"
end if
put empty into tURL
end postOnTwitter
Louis