ie=.OLEObject~new("InternetExplorer.Application") ie~visible=.true -- make IE visible ie~navigate("https://bach.wu.ac.at/z/start") do counter i until ie~busy=.false | i>1000 -- wait for page to be loaded (maximum one second) call sysSleep 0.001 -- sleep 1/1000 second end doc=ie~document -- get loaded document source=doc~body~innerHtml -- get body element and get its HTML text ie~quit -- close Internet explorer -- parse the HTML text to extract a specific URL parse var source '

WU

' . 'WU Directory<' say "Current URL of BACH-WU Directory:" url Word = .OLEObject~New("Word.Application") /* set Word visible to see what happens */ Word~Visible = .TRUE /* new document */ Document = Word~Documents~Add /* get the selection object */ Selection = Word~Selection /* type two lines of text and new paragraph */ Selection~TypeText(url) /* select all */ Selection~WholeStory /* get the font object */ Font = Selection~Font /* change the font size and behavior */ Font~Name="Arial" Font~Size="12" Font~Bold = .TRUE Font~Italic = .TRUE /* get the environment variable TEMP and create filename to save */ TempDir = VALUE( "TEMP",,ENVIRONMENT) -- use ".doc" instead of ".docx" to allow older Word apps to work: FileName = TempDir || "\" || "WordCreatedByRexx.doc" /* "save as..." and close Word */ Document~SaveAs(FileName)