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
| #popclip - Search Bing using Chrome in the background | |
| name: Bing | |
| icon: B | |
| applescript: | | |
| tell application "Google Chrome" | |
| set isActive to frontmost | |
| activate | |
| set theWindow to window 1 | |
| set theTabIndex to active tab index of theWindow | |
| set theBaseURL to "https://www.bing.com/search" |
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
| let src = CGEventSource(stateID: .hidSystemState) | |
| let position = CGPoint(x: 500, y: 500) | |
| for i in 1...2 { | |
| let leftMouseDown = CGEvent(mouseEventSource: src, mouseType: .leftMouseDown, mouseCursorPosition: position, mouseButton: .left) | |
| let leftMouseUp = CGEvent(mouseEventSource: src, mouseType: .leftMouseUp, mouseCursorPosition: position, mouseButton: .left) | |
| leftMouseDown?.setIntegerValueField(.mouseEventClickState, value: Int64(i)) | |
| leftMouseDown?.post(tap: .cghidEventTap) | |
| leftMouseUp?.post(tap: .cghidEventTap) | |
| } |