-
Posts
8,486 -
Joined
-
Last visited
-
Days Won
707
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by vitor
-
-
That’s the behaviour. It searches words in the title.
-
26 minutes ago, dan22 said:
Could anyone let me know how to keep the Alfred Window open with the query results ?
That’s not available, but you can copy the output (or just the last answer) with the shortcuts listed at the bottom
20 minutes ago, CarREFuse said:Is there any plan that allows users to use different base url instead of OpenAI?
See the first item in the FAQ.
-
Welcome @ebleble,
Alfred uses the Spotlight metadata. You don’t need glob patterns (regular expressions are similar but distinct) and can just type somephrase pdf or pdf.
-
-
Instead of Snippets, you’re looking for a List Filter Input (you can load a CSV into it) connected to a Copy to Clipboard Output.
See the Getting Started Guide for an interactive tutorial on making a workflow.
-
Welcome @sweetgrass,
When sending text to a script you’re not doing it as continuous input but rather as an argument. In other words, you have to use $1. See Alfred’s placeholder text when creating a new Run Script with /bin/bash set as the language.
But even so, the code can be greatly simplified. There is a command-line tool in macOS whose whole purpose is counting lines. You should be able to replace the whole code with a single line:/usr/bin/nl -ba -d. -s'. ' -w 1 <<< "${1}"
Run man nl in a terminal for an explanation of the options.
That should return the same format you’re looking for. Though personally I don’t like that numbers can push lines to the right, so I’d do something like:
readonly digits="$(wc -l <<< "${1}" | tr -d '\n ' | wc -c | tr -d '\n ')" /usr/bin/nl -b a -d . -s '. ' -w "${digits}" <<< "${1}"
-
If you select it a couple of times, it should bubble to the top. See Understanding Result Ordering, in particular “2. Keyword Latching”.
-
Usage
Search for executables in PATH via the whereis keyword.
- ↩ Copy original path.
- ⌥↩ Copy resolved path if original is a symbolic link.
-
I don’t know what to tell you more than what’s been said. The Alfred workflow follows the API.
We’re not privy to your usage (nor do we want to be, we firmly believe in privacy and not collecting user data), but it does not seem accurate to say Alfred’s responses are always brief because the text comes 100% from the API response. There’s nothing that would cause shorter replies (and there have been no other reports of it) unless you’ve set up a system prompt to tell it to make brief answers (you can confirm that in the workflow’s configuration).
Again, we don’t have (and don’t want to have) any control over how OpenAI charges you. The workflow follows the API as it is documented and this can be verified by looking at the code which is available in its entirety. If anyone spots an opportunity for optimisation (and I know lots of people have been looking at the code) they are welcome to suggest it. Anything further than that regarding your usage only OpenAI can say.
-
You probably have CTRL as one of the keys in Alfred Preferences → Features → Universal Actions → Show Actions.
-
9 minutes ago, gingerbeardman said:
Any plans to add support for Temp Mail? https://temp-mail.org/en/
temp-mail is quite good, but not automatable like the others where you can predictably create an email address and open a page for it. I looked into it quite a while ago and abandoned it. I’m willing to add it if someone finds a way (not with the RapidAPI thing, that doesn’t fit well and is a hassle).
-
11 hours ago, pseudocannon said:
Do I need to use specific browser?
Firefox won’t work but other browsers should. I suspect you may be missing Automation Tasks.
-
I see, thank you for explaining. Just offering another alternative here: have you considered making the Text View text editable? That way users can edit the text in place. It seems more straightforward than having to know the specific syntax to input in the box.
-
Welcome @Brandon Faloona,
That looks like a connection issue. Have you retried the installation?
Are you able to access GitHub at all in a web browser? What about downloading this file?
-
12 hours ago, caleb531 said:
would need to pass a variable (e.g. {var:default_text}) as that initial value of the input.
Why not use an Arg and Vars Utility to send that as a query? That’s what the ChatGPT / DALL-E workflow does.Extending the JSON doesn’t really seem like it’d solve what you want, from the description. What’s the use case for populating the input field instead of directly doing the thing?
-
@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.
-
You don’t need a separate script to run the trigger. And use the AppleScript instead of the URL:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.jct.runalfredchrono.plist</string> <key>LimitLoadToSessionType</key> <string>Aqua</string> <key>ProgramArguments</key> <array> <string>/usr/bin/osascript</string> <string>-e</string> <string>tell application id "com.runningwithcrayons.Alfred" to run trigger "run" in workflow "jct.chrono"</string> </array> <key>StartInterval</key> <integer>60</integer> <key>KeepAlive</key> <true/> <key>RunAtLoad</key> <true/> <key>StandardErrorPath</key> <string>/dev/null</string> <key>StandardOutPath</key> <string>/dev/null</string> </dict> </plist>
-
If you notice, Alfred’s file search returns results as you type and is smart about what to show and how many results. What you’re asking for, returning every file on the system with previews, would be resource intensive and would take a while to get everything showing. Performance is important.
To have an idea of how long it takes just to list every file on just your home directory try this in a Terminal: /usr/bin/find ~ You can abort the command at any time by pressing ⌃C or closing the window. -
Could you share the workflow? So we can properly look at the config and replicate live to see what’s happening?
-
You don’t have to remove the extension, but you do have to add the shebang. That’s not a workaround, but rather exactly the correct procedure in any Unix operation system (including macOS). This works exactly the same in the Script Filter if you use External Script as the mode of execution.
There is a difference between opening a file and executing it. The extension is irrelevant in the latter. For example, you could name your file my_script.rb (i.e. have a Ruby extension), but because you have the python shebang it will still execute correctly. This is normal and expected. Consider, for example, if you installed multiple interpreters for the same language (e.g. one for Python 2 and another for Python 3), and you have scripts in both languages (which, as you probably know are likely incompatible since Python broke backwards compatibility of a lot of things in the transition). How would the system know if a .py is for version 2 or 3? And how would it distinguish between opening for editing or for executing? The answer is the shebang, it’s what informs the system where to pipe that text file (the script) to the correct executable.
Conversely, let’s say that in a Script Filter you set your language to Bash or Zsh and then in the code have something like /usr/bin/python3 my_script.py. Again the extension is irrelevant, but in this case so is the shebang because you’re already telling the script how exactly you want the file to be executed. Or rather, you told the python interpreter to execute the file. In this case, you could even have a my_script.rb with the shebang #!/usr/bin/ruby, but because you said /usr/bin/python3 my_script.rb, then it will be executed by Python.
In other words, using the shebang or the interpreter are different ways of accomplishing the same thing. The shebang is an integral part of the execution model.
So to reiterate, your file can still be my_script.py but it does require the shebang. -
Welcome @csjaugustus,
Yes, you can use literally any language, just like the Script Filter. All your stated assumptions are correct, but note the message (emphasis added): The external script may not exist, or doesn't have execute (+x) permissions. What you have to do is locate your script inside the workflow’s folder and (with a terminal) do chmod +x /PATH/TO/SCRIPT/HERE, which will make it executable.
When you create the script directly from Alfred by setting the Text View source to Script, typing a name, and pressing Create, that is automatically done for you. -
You can set the mods in the Script Filter’s JSON, with custom text. You can go further: have mods in your Script Filter set the subtitle text and a variable whose name is consistent for each modifier but the value is specific. Then, from your Script Filter you’ll only have one connection out to a conditional which checks the variable’s value and branches accordingly.
I use this technique in a few workflows, e.g Pin Plus. -
8 minutes ago, PBerg said:
I'll be back for more workflow questions once I have figured out the next handy tool I want to build
For sure!
If you haven’t yet, I recommend you check the Getting Started Guide for an interactive tutorial on making workflows. @Stephen_C is also creating a series on Simple Ideas and @Vero is making videos on workflows and features. There are also workflows in the Gallery which are good examples of ideas you can make even without code. Finally, the documentation is quite comprehensive. You can click the (?) in any object to go directly to it.
And we’re here for any questions.
Have a great weekend!
-
Welcome @PBerg,
Note that the folders indicated by the variables @Stephen_C mentioned still have to be created. In your case, the easiest way would be to use the Write Text File Output with Create any intermediate folders turned on. Then use the File Contents Automation Task to read the file back.
44 minutes ago, PBerg said:But I suspect that this is inefficient.
It’s not, that’s how you’re supposed to do it. If you want to save data for later, you have to save it somewhere. The reason you should use one of the folders @Stephen_C mentioned instead of the workflow’s own folder is that by using the latter you’re kind of changing the workflow itself. Which mostly doesn’t matter unless:
- You’re sharing the workflow with someone else. You wouldn’t want your personal text to be packaged with the workflow.
- The file you’re saving is large, which increases the size of the workflow and could take up more space in syncing.
Regular expressions support for file search
in Discussion & Help
Posted
What you seem to be looking for is fuzzy finding. FZF is a community workflow for that.