팁&테크/MAC OS

알프레드(Alfred) 카카오톡(Kakao Talk) 채팅방 검색 워크플로우(Workflow)

KeNee 2020. 10. 14. 13:24

알프레드4 용 워크플로우 입니다.

워크플로우 keyword 하나 만드시고 뒤쪽에 run AppleScript (NSapplescript) 하셔서 아래쪽 코드를 복사해서 붙여넣기 하고 쓰시면 됩니다.

 

사용법: 키워드 채팅방명, 할말

---alfred4 용 workflow

KakaoTalk Chatroom Finder_public.alfredworkflow
0.00MB

----- Applescript

on alfred_script(q)
set args to splitText(q, ",")
tell application "KakaoTalk"
    reopen -- unminimizes the first minimized window or makes a new default window
    activate (first window whose name is "카카오톡") -- makes the app frontmost
end tell
tell application "System Events" to key code 19 using command down -- activate main window
delay 0.3
tell application "System Events" to key code 3 using command down
delay 0.3
set the clipboard to item 1 of args
tell application "System Events" to key code 9 using command down
delay 0.5
tell application "System Events" to key code 125
tell application "System Events" to key code 36
set the clipboard to item 2 of args
tell application "System Events" to key code 9 using command down
tell application "System Events" to key code 36
end alfred_script
on splitText(theText, theDelimiter)
        set AppleScript's text item delimiters to theDelimiter
        set theTextItems to every text item of theText
        set AppleScript's text item delimiters to ""
        return theTextItems
end splitText