Jump to content

vitor

Staff
  • Posts

    8,511
  • Joined

  • Last visited

  • Days Won

    708

Reputation Activity

  1. Like
    vitor got a reaction from sepulchra in Where’s the Binary — Get the full path to executables in your PATH   
    Usage

    Search for executables in PATH via the whereis keyword.


    ↩ Copy original path. ⌥↩ Copy resolved path if original is a symbolic link.
    ⤓ Install on the Alfred Gallery | Source
  2. Like
    vitor got a reaction from Alan He in Where’s the Binary — Get the full path to executables in your PATH   
    Usage

    Search for executables in PATH via the whereis keyword.


    ↩ Copy original path. ⌥↩ Copy resolved path if original is a symbolic link.
    ⤓ Install on the Alfred Gallery | Source
  3. Like
    vitor got a reaction from zeitlings in Where’s the Binary — Get the full path to executables in your PATH   
    Usage

    Search for executables in PATH via the whereis keyword.


    ↩ Copy original path. ⌥↩ Copy resolved path if original is a symbolic link.
    ⤓ Install on the Alfred Gallery | Source
  4. Like
    vitor reacted to caleb531 in Pre-populating a Text View's Script Input field with an initial value   
    @vitor I have at least considered that, although depending on how they edit the preview, it may not be clear how to derive the new format string. My hope is that because the Script Input and the Text View response are both displayed as separate things, that I could allow them to edit the format string and see a live preview of how it would render out. It would be the best of both worlds. And if they enter an invalid syntax for the format string (within the Script Input field), then the Text View response body would display an appropriate error message in place of a rendered preview.
     
    But you still make an interesting argument. If I relinquish my need for a preview, I could render the format string into the Text View response body in Editable mode. Then I could perhaps use the footer text to render out any error messaging. I will look into this. Thank you!
  5. Like
    vitor got a reaction from naukc in ChatGPT / DALL-E - OpenAI integrations   
    @naukc You need to install the Automation Tasks.
     
    @3point ChatGPT (and any other LLM) doesn’t “know” anything, it strings text together. Check OpenAI’s own models page; GPT-4’s cut-off date is April 2023 while GPT-3’s cut-off date is September 2021. So the answer you were given is contradictory, it can’t both have a cut-off date of April 2023 and be GPT-3. In other words, you are using GPT-4. Asking it what model it is is particularly unreliable, I’ve been reproducing that wrong answer for quite a while.
  6. Like
    vitor got a reaction from 3point in ChatGPT / DALL-E - OpenAI integrations   
    @naukc You need to install the Automation Tasks.
     
    @3point ChatGPT (and any other LLM) doesn’t “know” anything, it strings text together. Check OpenAI’s own models page; GPT-4’s cut-off date is April 2023 while GPT-3’s cut-off date is September 2021. So the answer you were given is contradictory, it can’t both have a cut-off date of April 2023 and be GPT-3. In other words, you are using GPT-4. Asking it what model it is is particularly unreliable, I’ve been reproducing that wrong answer for quite a while.
  7. Like
    vitor got a reaction from Alan He in ChatGPT / DALL-E - OpenAI integrations   
    Frequently Asked Questions (FAQ)

    How do I set up an alternative AI model?

    The workflow offers the ability to change the API end points and override model names in the Workflow Environment Variables. This requires advanced configuration and is not something we can provide support for, but our community are doing it with great success and can help you on a different thread.

    How do I access the service behind a proxy?

    Add a new https_proxy key in Workflow Environment Variables. Or configure the proxy for all workflows under Alfred Preferences → Advanced → Network.

    Why can’t I use the workflow with a ChatGPT Plus subscription?

    The ChatGPT Plus subscription does not include access to the ChatGPT API and are billed separately.

    Is there a video which shows how to use the workflow?

    Yes, on YouTube.

    How do I report an issue?

    Accurate and thorough information is crucial for a proper diagnosis. When reporting issues, please include your exact installed versions of:
    The Workflow. Alfred. macOS. In addition to:
    The debugger output. Perform the failing action, click “Copy” on the top right and paste it here. Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.  
    Why do I keep getting [Connection Stalled]?
     
    This happens when the workflow takes too long to receive a reply from the API. It indicates a problem either with your connection or OpenAI’s service.

    Open a terminal and run the following (replace the YOUR_API_KEY text within the quotes with your API key):
     
    openai_key="YOUR_API_KEY" time /usr/bin/curl "https://api.openai.com/v1/chat/completions" --header "Authorization: Bearer ${openai_key}" --header "Content-Type: application/json" --data '{ "model": "gpt-3.5-turbo", "messages": [{ "role": "user", "content": "What is red?" }], "stream": true }'
    It should provide a clue as to what is happening. Include the result in your report.
  8. Like
    vitor reacted to csjaugustus in Is it possible to use a Python script with Text View?   
    That totally solved it. Thanks a lot for your detailed explanation!
  9. Like
    vitor reacted to Stephen_C in Simple Ideas: double trouble—hidden delights of the Keyword Input   
    Background
    Alfred's Keyword Input is more versatile than you might at first suppose. Of course you can use a keyword without any argument: I use one like that to open a deeply nested menu item in Day One.

    However there's much more you can do with the Keyword Input.

    The skeletal workflow


    Explanation
    1. In order to set your teeth on edge we'll use the keyword Fraze. If we double click on the Keyword Input this is what we see:


    It shows the keyword we're using to trigger the workflow and indicates that should be followed by <space>, an argument then ⏎. The argument is the first part of the phrase.

    Note the title forms a helpful prompt we'll see when we trigger the workflow. Prompts are really important and helpful prompts really facilitate the use of workflows—so make use of them!

    If we trigger the workflow we can type the first part of our phrase:


    Note we've sensibly added a space at the end of the phrase because we know we're going to add a second part. However, never trust users! So, after…

    2. Telling Alfred not close his window (explained in this post)…

    3. We take control of spaces, decide to deal with them ourselves in order to avoid nasty surprises, so use an Automation Task simply configured (by double clicking on it) to remove trailing white space.

    4. We save the first part of the phrase to a variable:


    We use a variable because we want to take control of assembly of the phrase.

    5. It's time to prompt for the second part of the phrase and to reveal a very neat trick of Keyword Inputs:


    This time we don't use any keyword. This Keyword Input is simply a device to collect more user input in the course of the workflow. We still require an argument (the second part of the phrase) so we leave that as is. Note again we have a helpful prompt. This one reminds the user of the first part of the phrase by using the variable we created in 4 above but with an added ellipsis and quotation marks.


    6. After again telling Alfred not to close his window…

    7. We use another Automation Task to trim white space—but this time from the start of the second part of the phrase just in case a user has tried to be clever.

    8. At last we can assemble the whole phrase:


    Our variable introduces and quotes the phrase and takes control of the spacing between the two parts of the phrase.

    9. All we then need to do is to put our variable into Alfred's Large Type Output:


    so that when the workflow runs with our inputs it shows Your phrase is: 'Spam is significantly overrated'. You don't really need another screenshot just to show that it works, do you?

    In conclusion
    You can use a Keyword Input without a keyword to scoop up more user input in the course of a workflow—and, of course, you can do that as many times as you need. However, do remember to provide users with helpful prompts when they have to respond to any Keyword Input that requires user input.

    Stephen

    The Simple Ideas posts
  10. Like
    vitor got a reaction from iandol in ChatGPT / DALL-E - OpenAI integrations   
    Thank you.
     
     
    That is correct.
     
     
    Make a new workflow with a Keyword Input and connect it to an Arg and Vars Utility with your custom text plus {query} for the new input from the Keyword. Then connected it to a Call External Trigger Output set to open continue_chat from this workflow.
  11. Like
    vitor reacted to zeitlings in Keyword followed by variable not working   
    The script filter expects a specific JSON object as a result that contains information about what to display. Instead of echoing the argument directly, you have to wrap it in this format if you want it to "see" what you typed. Otherwise Alfred will jump to the default fallback because it doesn't know what to do. There is a script filter example under the "getting started" section when creating a new workflow that lets you inspect the format.
     
    In short, you would want to do something like this:
     
    local input="placeholder" [[ ! -z "$1" ]] && input="$1" cat << EOB {"items": [ { "title": "$input", "subtitle": "$input", "arg": "$input" } ]} EOB  
  12. Like
    vitor reacted to Stephen_C in Simple Ideas: the Big Bang & Universal Actions   
    Background
    Approximately 13.8 billion years ago the universe exploded from a hot, dense soup of sub-atomic particles and has been expanding ever since. You are part of the expanding universe.

    Approximately 32 months ago Universal Actions exploded from Alfred 4.5 and have been expanding ever since. You can also be part of expanding Universal Actions: find out how—and why—it's better not to remain in a hot, dense state.

    There are few skeletons (just one) in this tiny cupboard in the universe: we don't start with a skeletal workflow. We have—horror—a non-standard layout for this "Simple Ideas” post.

    What are Universal Actions?
    At its most basic a Universal Action is an action in Alfred that acts on something you have selected: a file, a URL or text. However a Universal Action can also act on Alfred's results, file navigation or clipboard history (see below).

    Alfred has a large list of inbuilt Universal Actions. You can see them by opening Alfred Preferences → Features → Universal Actions and clicking on the Actions tab. While you're there you can un-check any that you don't want to see.

    How do I use a Universal Action?
    1. You can first select something (a file, a URL or some text) to use a Universal Action. When you have done so you can use your Universal Actions Selection Hotkey (go to  Alfred Preferences → Features → Universal Actions: it's ⌘/ by default) and that will display a list of Universal Actions relevant to what you have selected (i.e., text, file or URL).
    2. You can also use Universal Actions on Alfred's search results, File Navigation and Clipboard History. In those cases, simply use your Actions shortcut to show the Universal Actions relevant to the appropriate item. (The Actions key is set in  Alfred Preferences → Features → Universal Actions under Show Actions: and is → by default.)

    Here's what I see when I use Alfred to go to my ~/Downloads folder and then use →:


    (Your view will not be identical because you'll not have the same Universal Actions. Note also that Alfred remembers which Universal Actions you last used so the results will be ordered accordingly.)

    If I use Clipboard History, choose an item with text on the clipboard and press → I see this:


    Note that Alfred knows whether what you have selected is a folder or text (or, indeed, a URL). The beauty of Alfred's Universal Actions is that they're omnipresent (the clue may be in the name), intelligent and instantly accessible.

    I want to live in my own universe: how do I create a Universal Action?
    This is very easy. Here's a really simple example which converts text to lower case <produces following skeleton from cupboard>:


    We start with a Universal Action (which is probably not a major surprise to alert readers):


    We give it a name (remember, that's what's going to appear in our list of Universal Actions whenever, one way or another, we select some text), choose Text as its target and Single Input Arguments. (The alternatives are Single, Single and Multiple and Multiple: you can imagine the latter two are particularly useful when we're dealing with files, for example.)

    2. Connected to the smart little Transform Utility…


    3. …we simply then copy the result to the clipboard by using the Copy to Clipboard action in its default state.
     
    The result, of course, is that any capital letters in the text are now converted to lower case (you don't really need another screen shot, do you?).

    In conclusion
    27% of the Alfred workflows I use (numbering just over 100) are Universal Actions (or use a Universal Action in addition to another trigger). Those of course, are in addition to Alfred's inbuilt Universal Actions. Perhaps that's some indication of their usefulness…and it didn't take (even) me 13.8 billion years (or even 32 months) to build them.

    P.S. Alfred's File Action Trigger is important in the context of Universal Actions but you will be relieved to know there is a limit to the amount that should be crammed into one post so that will be the subject of a separate post…at some time.

    Stephen

    The Simple Ideas posts
  13. Like
    vitor got a reaction from ThanhD in ChatGPT / DALL-E - OpenAI integrations   
    Updated to 2024.6.
    Add chat history feature. Add option to archive images. Add Fallback Search. Add option to start new chat to Universal Action and Fallback Search. Do not close window on relevant steps. Support Organisation ID. Add model override for ChatGPT.

  14. Thanks
    vitor got a reaction from Send Me in Screenshots — Search and act on screenshots   
    That request has been made more than once, so I’ll consider it. But no promises yet or ETA.


     
    @LaterTater There’s nothing wrong with that behaviour, it’s working exactly as expected. To copy to the clipboard you have to ⌘↩, as explained in the instructions.
  15. Like
    vitor reacted to sepulchra in Integration with Elgato Stream Deck   
    @Crystal Taggart to follow up on what Vitor just posted. I use a stream deck with Alfred often. I call external triggers with this plugin for stream deck:
     
    https://apps.elgato.com/plugins/com.gabrielperales.osascript
     
     
  16. Like
    vitor got a reaction from Crystal Taggart in ChatGPT / DALL-E - OpenAI integrations   
    Setup
    Create an OpenAI account and log in. On the API keys page, click + Create new secret key. Name your new secret key and click Create secret key. Copy your secret key and add it to the Workflow’s Configuration. Hot tip: Using earlier models (e.g. ChatGPT 3.5 and DALL·E 2) is the most cost-effective way to use these OpenAI tools and stretch your credit a long way!

    Usage

    Query ChatGPT via the chatgpt keyword.




    ↩ Ask a new question. ⌘↩ Clear and restart chat. ⌥↩ Copy last answer. ⌃↩ Copy full chat. ⇧↩ Stop generating answer. Query DALL·E via the dalle keyword.




    ↩ Send a new prompt. ⌥↩ Reveal the most recent image in the Finder. ⤓ Install on the Alfred Gallery | Source
  17. Like
    vitor got a reaction from Vero in ChatGPT / DALL-E - OpenAI integrations   
    Updated to 2024.6.
    Add chat history feature. Add option to archive images. Add Fallback Search. Add option to start new chat to Universal Action and Fallback Search. Do not close window on relevant steps. Support Organisation ID. Add model override for ChatGPT.

  18. Like
    vitor got a reaction from Andrew in ChatGPT / DALL-E - OpenAI integrations   
    Updated to 2024.6.
    Add chat history feature. Add option to archive images. Add Fallback Search. Add option to start new chat to Universal Action and Fallback Search. Do not close window on relevant steps. Support Organisation ID. Add model override for ChatGPT.

  19. Like
    vitor got a reaction from JJJJ in ChatGPT / DALL-E - OpenAI integrations   
    Updated to 2024.6.
    Add chat history feature. Add option to archive images. Add Fallback Search. Add option to start new chat to Universal Action and Fallback Search. Do not close window on relevant steps. Support Organisation ID. Add model override for ChatGPT.

  20. Like
    vitor got a reaction from football12908 in Can Alfred workflows run Terminal commands?   
    To add to Stephen’s answer, look also at Run Scripts, which are a way to do it without opening a Terminal. And Script Filters which can run code and output results in Alfred itself, as can the Grid View and Text View.
     
    In other words, yes, Alfred can do it in a myriad of ways. See the Getting Started Guide for an interactive tutorial on making a workflow and check the comprehensive documentation to learn even more.
  21. Like
    vitor reacted to Stephen_C in An explanation of the "Simple Ideas” posts   
    @sepulchra thanks for the ideas…but I think we need to come to some sort of arrangement. You see, I'm a little ashamed to admit that I don't use Snippets (I've used Typinator for years) so I think you should do the ones involving Snippets. 😀
     
    However, I shall adopt Vitor's suggestion for a deconstruction of some of my non-code workflows—and, in doing that, cater for some of the ideas you mentioned. I'll just cover a little more basic stuff first and then, when we have all the building blocks in place, start with some of my basic workflows.
     
    Please feel free to continue to comment (your comments are always valuable) and to contribute anything along the same lines!
     
    Stephen
  22. Like
    vitor got a reaction from sepulchra in An explanation of the "Simple Ideas” posts   
    Don't worry about it, I’ve only been seeing positive reception! Keep ’em coming!
     
     
    That is so so much the right attitude. Thumbs up.
     
     
    Any of your workflows which is done without code seems like a perfect candidate for a deconstruction.
     
    And here’re a neat trick. A URL for all of your Simple Ideas posts: https://www.alfredforum.com/search/?&q="Simple ideas%3A"&author=Stephen_C&search_and_or=and&search_in=titles&sortby=relevancy
  23. Like
    vitor got a reaction from Alan He in Calling non-standard runtimes from Alfred   
    When configuring a Run Script or Script Filter, Alfred provides a Language dropdown listing the runtimes which have historically been included with macOS. But what if you want to run a script from another language which you have installed on your system? Be it Node.js, Lua, or something else, it’s dead-simple to call them. Either:
    Save your script with a proper shebang (examples: #!/usr/bin/env node; #!/usr/bin/env lua) and use External Script as the Language, pointing to your script. Use /bin/zsh (or /bin/bash) as the Language and tell the runtime to call your script (examples: node MY_SCRIPT.js; lua MY_SCRIPT.lua). The first executes (marginally) faster but the second allows you to send preset arguments to your script. They work as they are assuming the languages were installed with Homebrew, as Alfred includes its directories in its PATH.
  24. Like
    vitor got a reaction from Stephen_C in An explanation of the "Simple Ideas” posts   
    Don't worry about it, I’ve only been seeing positive reception! Keep ’em coming!
     
     
    That is so so much the right attitude. Thumbs up.
     
     
    Any of your workflows which is done without code seems like a perfect candidate for a deconstruction.
     
    And here’re a neat trick. A URL for all of your Simple Ideas posts: https://www.alfredforum.com/search/?&q="Simple ideas%3A"&author=Stephen_C&search_and_or=and&search_in=titles&sortby=relevancy
  25. Like
    vitor got a reaction from Alan He in Text View script can be nodejs?   
    Use a shebang in your script and make it executable. That box is essentially the same as the External Script option in Run Scripts and Script Filters.
×
×
  • Create New...