I finally gave up on using SOAP calls for this project. A better way was suggested by Kirk McElhearn, thank you very much. Applescript’s DO SHELL SCRIPT command returns whatever text the unix shell puts out (or in–I have to read Kirk’s book about shell commands to see what’s going on here), and curl is a unix command that can get a web page into the standard input buffer (I guess). Once in, the text of the page can be searched for the info you need using another command, grep, which finds whole lines of text having the given search string. A third command, cut, is used here to ferret out just the sought characters - the net asset values of my funds.
Thanks also to Bob Y of Bob’s Mutual Funds Page, whose web site turned out to be very searchable and easy to use, both by just browsing it, and by using curl and grep:
http://customer.wcta.net/roberty/index.html
– My Portfolio
set funds to {“BUFSX”, “PRFDX”, “PRSCX”, “SCGEX”, “SMTVX”, “VGHCX”}
set shares to {241.354, 434.764, 293.067, 558.729, 334.741, 181.834}
set NAVs to {“”}
set numFunds to length of funds
set thisDate to date string of (current date)
set NAVs to NAVs & (do shell script “curl -s www.buffalofunds.com/index.html | grep BUFSX | grep '> ’ | cut -c 379-383”)
set NAVs to NAVs & (do shell script “curl -s customer.wcta.net/roberty/XP.HTM | grep PRFDX | cut -c 114-119”)
set NAVs to NAVs & (do shell script “curl -s customer.wcta.net/roberty/XP.HTM | grep PRSCX | cut -c 118-122”)
set NAVs to NAVs & (do shell script “curl -s customer.wcta.net/roberty/XS.HTM | grep SCGEX | cut -c 114-118”)
set NAVs to NAVs & (do shell script “curl -s customer.wcta.net/roberty/XS.HTM | grep SMTVX | cut -c 114-118”)
set NAVs to NAVs & (do shell script “curl -s customer.wcta.net/roberty/XV.HTM | grep VGHCX | cut -c 113-118”)
set NAVs to the rest of NAVs
set value to 0
set Total to 0
set msgString to "John’s Portfolio as of " & thisDate & return & return & “Fund Shares NAV Value” & return & return
repeat with loopVar from 1 to numFunds
set theseShares to item loopVar of shares
set thisNAV to item loopVar of NAVs as real
set msgString to msgString & item loopVar of funds & tab & tab & tab & theseShares & tab & tab & tab & thisNAV & tab & tab & tab
set value to theseShares * thisNAV
set value to value as integer
set Total to Total + value
set msgString to msgString & “$” & value & return
end repeat
set msgString to msgString & return & “Total value now: $” & Total & return
display dialog msgString