Skip to content

Instantly share code, notes, and snippets.

@0xOsprey
Created May 12, 2024 22:36
Show Gist options
  • Save 0xOsprey/2c5e780753dd3ff82e8a3941e28d6724 to your computer and use it in GitHub Desktop.
Save 0xOsprey/2c5e780753dd3ff82e8a3941e28d6724 to your computer and use it in GitHub Desktop.
Raycast script for searching telegram username
#!/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