NOTE: the bbcode of this site is surrounding the urls in my AS code below with the {URL} and {/URL} brackets…those should not be there. The code looks fine except for those.
this is a weird one. but, perhaps just due to my inexperience
My script is much more advanced than what I’m posting below. But, I’ve simplified it to replicate the issue. But, all I’m doing is creating a variable in AS and passing it to the shell to do some AWK stuff. But, I’ve found the string isn’t making it out of AS in tact.
The only difference between the following two snippets is I return the variable in AS in the first one. This returns the properly formatted URL with ‘http’ at the beginning.
set theString to "Frank%20Palmer%0James%20Hamilton"
set theURL to "http://www.mywebsite.net/search=" & theString
return theURL
do shell script "theAddress=$" & theURL & "
echo 'the URL is' $theAddress"
In this second bit, I’ve only removed the return line so that shell echos back the variable. And, the ‘http’ is stripped off.
I’m scratching my head. I don’t know what is wrong here. Any suggestions?
set theString to "Frank%20Palmer%0James%20Hamilton"
set theURL to "http://www.mywebsite.net/search=" & theString
do shell script "theAddress=$" & theURL & "
echo 'the URL is' $theAddress"