Ever since Yahoo changed the ability to easily download option chains I have been trying to write an Applescript to do the job. I seem to have got stuck on something I feel is simple. Using UI Browser I was able to get the correct sequence to the table I wanted but I the cannot paste it into something like Excel in fact t does not show as a string or text but the script compiles and completes. The following script fails at the last display dialog SelecteTable I have tried coercing the result as a string and text and they do not work either. What I want to do is paste the table “SelectedTable” into Excel. Any suggestions appreciated .
global SYM
global SelectedTable
tell application "Safari"
display dialog "Enter Stock Symbol" default answer ""
set SYM to text returned of result
make new document with properties {URL:"https://finance.yahoo.com/quote/" & SYM & "/options?"}
end tell
delay 5
tell application "System Events"
tell process "Safari"
set SelectedTable to {select table 1 of group 9 of UI element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window 1}
--display dialog SelectedTable
end tell
end tell