Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AppleScript for www.alfredapp.com for Sipage. You need to be logged in at sipgate.com at the same time
on alfred_script(q)
tell application "Google Chrome"
set ActivePage to window 1
set CallTab to make new tab at end of tabs of ActivePage
set URL of CallTab to "https://app.sipgate.com/"
delay 1
set jscode to "function post(path, params, method) { method = method || 'post'; var form = document.createElement('form'); form.setAttribute('method', method); form.setAttribute('action', path); for(var key in params) { if(params.hasOwnProperty(key)) { var hiddenField = document.createElement('input'); hiddenField.setAttribute('type', 'hidden'); hiddenField.setAttribute('name', key); hiddenField.setAttribute('value', params[key]); form.appendChild(hiddenField); } } document.body.appendChild(form); form.submit(); } post('https://secure.live.sipgate.de/ajax-fast.php/account/click2dial/', {from: '2373479e0', to: '" & q & "'});"
execute front window's active tab javascript jscode
delay 1
close active tab of window 1
end tell
end alfred_script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment