Skip to content

Instantly share code, notes, and snippets.

@m0pfin
Created May 8, 2020 11:28
Show Gist options
  • Save m0pfin/e73bbb36b65faf691d80b3eb1ffebe52 to your computer and use it in GitHub Desktop.
Save m0pfin/e73bbb36b65faf691d80b3eb1ffebe52 to your computer and use it in GitHub Desktop.
AppleScript - на автомате достаём токен в буффер обмена из INDIGO на MacOS
-- Достаём токен из 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