Skip to content

Instantly share code, notes, and snippets.

View m0pfin's full-sized avatar
:octocat:
Working from home

m0pfin

:octocat:
Working from home
View GitHub Profile
@m0pfin
m0pfin / tokenExtractSafari
Created May 8, 2020 08:18
AppleScript (P.S - Thx Adam JS love))
tell application "Safari"
tell window 1
set current tab to make new tab with properties {URL:"https://facebook.com/adsmanager"}
delay 5
end tell
do JavaScript "var re = new RegExp('access_token\"?:\"(.*?)\"');
var m = document.documentElement.innerHTML.match(re);
function copyToClipboard(text){
var copytext=document.createElement('input')
@m0pfin
m0pfin / keyEmulator
Last active May 6, 2020 10:08
AppleScript
-- Эмулятор клавиатуры на AppleScript: CMD+T
-- В данном примере запускает Хром и открываем новую вкладку
tell application "Google Chrome" to activate
tell application "System Events" to key code 17 using command down
delay 0.9
@m0pfin
m0pfin / copyTextToFile
Last active May 6, 2020 01:36
AppleScript
-- Выбираем файл
-- И копирует содержимое файла
set fileCards to "~/applescript/acc.txt"
set theText to read fileCards
set theTextList to paragraphs of theText
@m0pfin
m0pfin / setNameProfile
Created May 6, 2020 01:30
AppleScript
-- Устанавливаем название и копируем в буффер обмена
set nameProfile to "Auto_"
set numberProfile to (current date) as text
set the clipboard to nameProfile & numberProfile