Created
May 8, 2020 11:28
-
-
Save m0pfin/e73bbb36b65faf691d80b3eb1ffebe52 to your computer and use it in GitHub Desktop.
AppleScript - на автомате достаём токен в буффер обмена из INDIGO на MacOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Достаём токен из AdsManager FB, в INIDGO | |
set myLink to "https://facebook.com/adsmanager" | |
tell application "Chromium" | |
activate | |
open location myLink | |
delay 5 | |
execute active tab of window 1 javascript "var re = new RegExp('access_token\"?:\"(.*?)\"'); | |
var m = document.documentElement.innerHTML.match(re); | |
navigator.clipboard.writeText(m[1]) | |
.then(() => { | |
// Получилось! | |
alert('Токен скопирован в буффер обмена!'); | |
}) | |
.catch(err => { | |
alert('Ошибка: ', err); | |
});" | |
delay 3 | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment