Okay, I am very new to this but I am determined to learn. I have a very specific task that I want my apple to perform. Do you think it is possible for AppleScript to READ a consistently refreshing web page and when a certain EXACT block of characters appears, launch Skype and dial a phone number? I know that ANYTHING is possible on one of these amazing machines but I should clarify, is it possible for a newb like me to figure it out? Many thanks to anyone that takes the time to reply.
Model: MacBook Pro 2010
Browser: Safari 534.54.16
Operating System: Mac OS X (10.7)
I hope this helps! I’ve linked to skype’s api below if you want to look farther into that, and a nice little utility called soundflower may let you redirect audio to and from your script. Automated replies anybody?
set site to "http://macscripter.net/" --The website to check
set textToFind to "applescript" --The text to search for
set skypeContact to "echo123" --The contact to call (I think a number owrks too)
repeat
set pageContent to do shell script "curl '" & site & "'" --Get the source of a web page via a terminal command
if offset of textToFind in pageContent is not 0 then --If the text is not in the page, the offset function will return 0, otherwise it'll return the character position of the start of the text.
tell application "Skype" --Start talking to skype
send command "CALL " & skypeContact script name "My Script" --Start a call
end tell
end if
delay 1 --Wait 1 second between each loop or we'd be usng a lot of cpu. For a application, look into idle loops.
end repeat
Skype api: http://developer.skype.com/public-api-reference#AppleScript