Created
May 12, 2024 22:36
-
-
Save 0xOsprey/2c5e780753dd3ff82e8a3941e28d6724 to your computer and use it in GitHub Desktop.
Raycast script for searching telegram username
This file contains 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
#!/usr/bin/osascript | |
# Dependency: This script requires Telegram to be installed: https://www.telegram.org | |
# Required parameters: | |
# @raycast.schemaVersion 1 | |
# @raycast.title Telegram Search | |
# @raycast.mode silent | |
# Optional parameters: | |
# @raycast.icon 💬 | |
# @raycast.argument1 { "type": "text", "placeholder": "Name" } | |
# Documentation: | |
# @raycast.author Michael Lajlev | |
# @raycast.authorURL https://github.com/lajlev | |
on run argv | |
### Configuration ### | |
set keystrokeDelay to 2.5 | |
set conversationKeystrokeDelay to 0.5 | |
### End of configuration ### | |
if application "Telegram" is running then | |
do shell script "open -a Telegram" | |
else | |
do shell script "open -a Telegram" | |
delay keystrokeDelay | |
end if | |
tell application "System Events" to tell process "Telegram" | |
keystroke "f" using {shift down, command down} | |
keystroke item 1 of argv | |
delay conversationKeystrokeDelay | |
key code 36 | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment