dkrasner / Simpletalk

Apache License 2.0
53 stars 3 forks source link

Browser name #120

Closed dkrasner closed 1 year ago

dkrasner commented 1 year ago

main points

been a while

This PR adds getBrowserName system command, which parses and returns the user agent string (as described here), effectively putting it in to the "it" variable.

This allows you to write scripts like:

on openCard 
    getBrowserName
    if it != "Firefox"
    then 
        sendWarning
    else
        deleteWarning
    end if
end openCard 

on sendWarning 
    tell area "Browser Warning" of current card to set "hide" to false
end sendWarning 

on deleteWarning 
    delete area "Browser Warning" of current card
end deleteWarning 

which i added to bootstrap.html