SKaplanOfficial / Raycast-PromptLab

A Raycast extension for creating powerful, contextually-aware AI commands using placeholders, action scripts, selected files, and more.
https://www.raycast.com/HelloImSteven/promptlab
252 stars 7 forks source link

Running PromptLab Commands via PopClip #34

Open ramzimalhas opened 4 months ago

ramzimalhas commented 4 months ago

Discussed in https://github.com/SKaplanOfficial/Raycast-PromptLab/discussions/29

Originally posted by **SKaplanOfficial** January 14, 2024 To use PromptLab commands with PopClip, you can wrap the deeplink for a command in a PopClip extension snippet. All placeholders or action scripts used in the command will still work as intended. For example, to replace the selected text with the response from AI, you can use this extension that runs the "Ask AI & Replace Selection" command (assuming you've installed the command from the store): ``` #popclip extension snippet to replace the selected text with output from Raycast AI name: Replace With AI Response icon: AI applescript: do shell script "open -g raycast://extensions/HelloImSteven/promptlab/search-commands?arguments=%7B%22commandName%22:%22Ask%20AI%20%26%20Replace%20Selection%22%7D" ``` We use Applecript and `open -g` to ensure the selected text comes from the target app rather than Raycast itself.