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

Switch browser or mail app #21

Closed austinmw closed 10 months ago

austinmw commented 1 year ago

Hi, how can I edit the Summarize Current Tab or Summarize Last Email commands so that they use different default apps (Edge instead of Safari, Outlook instead of Mail)?

SKaplanOfficial commented 1 year ago

Hi, Summarize Current Tab will use the active browser and works on Edge (just confirmed on my machine, but lmk if you're having any problems with it). For Summarize Last Email, you'll have to use a custom AppleScript placeholder that fetches the email from Outlook.

austinmw commented 1 year ago

Hi, this only seems to work for me when I have Safari open. When only Edge is open I get the message:

Summarize Current Tab I apologize, but there seems to be an error as the URL and the text are blank. Please provide the necessary information so I can assist you better.

SKaplanOfficial commented 1 year ago

Hmm, not sure why that's happening for you. Can you make sure Edge is enabled under System Settings > Privacy & Security > Automation > Raycast? Also, is this the base MS Edge app, or one of the other channels (Edge Canary/Dev/Beta)?

austinmw commented 1 year ago

Ah, it's Microsoft Edge Dev. Totally forgot about that, sorry! After installing non-dev Edge it works, thanks!

SKaplanOfficial commented 1 year ago

I have custom logic for each browser/browser type (Chromium-based, Safari, Orion, etc.), and didn't think to support anything but the main channels. I can look into that for the next version. In the meantime, if you want to keep using Edge Dev, you can replace the prompt with this:

Based on the following text obtained from the active browser tab, what am I looking at? In your answer, discuss the content and meaning of the website. If the URL or the text are blank, report an error. For context, here is the url: {{as:tell application "Microsoft Edge Dev"
    return URL of active tab of window 1
end tell}}:

And here is the text:
###
{{as:tell application "Microsoft Edge Dev"
    set theTab to active tab of window 1
    tell theTab
        return execute javascript "document.body.innerText;"
    end tell
end tell}}
###

You'll need to enable JavaScript via Apple Events in Edge under Tools > Developer > Allow JavaScript from Apple Events.