Passing ampersands through a shell script
Passing ampersands through a shell script
- Subject: Passing ampersands through a shell script
- From: hd <email@hidden>
- Date: Sun, 25 Oct 2009 01:34:34 +0000
Forgive me if this has been covered before, but…
I am passing the name and artist of the current iTunes track to a
shell script (which tweets it). The script below works fine, except if
there's an ampersand in the track title or artist name.
tell application "iTunes"
set thisTrack to current track
set trackName to thisTrack's name
set trackArtist to thisTrack's artist
end tell
set tweet to "is listening to " & trackName & " by " & trackArtist
set twitter_status to quoted form of ("status=" & tweet)
display dialog twitter_status
set results to do shell script "curl -u twittername:twitterpassword"
& " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json
"
If there's an ampersand (as in Kraak & Smaak) then the output is
posted to twitter, but the tweet ends just before the ampersand. Other
non-alphanumeric characters (",' etc) appear to be passed correctly.
Any ideas?
Thanks!
HD _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden