Kalaschnik
-
Posts
19 -
Joined
-
Last visited
Content Type
Blogs
Gallery
Downloads
Events
Profiles
Forums
Articles
Media Demo
Posts posted by Kalaschnik
-
-
But I want to conditionally overwrite icon.png with an icon that exists. If I delete icon: { path: iconPath }, I would have no chance to show custom-icon.png
For example, right now my results look like this:
Since I only got the tesla icon in: simple-icons/tesla.svg (see if condition above), I see the tesla icon, however the other icons should have the icon.png
-
I am iterating over an array, and within my map method, I want to check if the icon file exists (because it is okay if they don't). However, I cannot get this file checking to work. I also tried most other file existence methods: https://byby.dev/node-check-if-file-exists
.map((element) => { let iconPath = 'icon.png'; // Check if the file or path exists if (fs.existsSync(iconPath)) { iconPath = `${__dirname}/simple-icons/${element.name.toLowerCase()}.svg`; } return { title: `${element.display} (${element.name}) [${element.key}]`, subtitle: `${element.address.name}, ${element.address.line1}, ${element.address.line2}, ${element.address.contacts}, ${element.address.country}`, arg: element.key, icon: { path: iconPath }, autocomplete: element.key, valid: false, }; });
Is there maybe something already implemented to use a fallback icon, if the path has no target?
-
30 minutes ago, vitor said:
The way to force the autocomplete to expand on ↩ is to set valid to false. The Script Filter then reruns because the input changed. Presumably (haven’t verified), that workflow is checking if the input starts with a known string (t: or m:) to react accordingly.
That part is really helpful! Thank you vitor!
-
28 minutes ago, vitor said:
That part is unclear. There is an autocomplete key in Alfred’s Script Filter JSON, but no key. What exactly are you doing?
Sorry my bad, I meant arg!
-
Hey everyone,
I am writing my first workflow. After doing everything in JXA, I discovered https://github.com/sindresorhus/alfy, which I enjoy.
In my use case, I have a simple API endpoint returning JSON. In that endpoint, I can search/filter for a title, but I am interested in the key property. When pressing tab or enter I set autocomplete and the key to key.
In other words, a video is more helpful than my description:(Screen capture is from this workflow)
After pressing tab/enter on Breaking Bad, it takes the output key of it and launches like a new search instance.
How do I achieve this in JavaScript land?
-
Cool, I got it to work with Var/Args utility.
Is it possible to do this without Var/Args?
-
I started to use Alfred to open Website with a predefined browser:
Although I set a fixed browser, I would sometime rather open the website with a different browser (for web dev jobs). In this case I would like provide an argument.
Question
If the keyword "ex" would open example.com with Safari, I am looking for a solution that would allow me to do this: "ex c" which would open example.com with Chrome.
Anything like that in Alfred World?
-
Is there a way to disable the default settings hits and only show the setting hits from the workflow?
-
Turning Word based off fixes that issue.
-
I observed a behavior that fuzzy search in snippets fails when it is not prepended with a space.
To be flexible in search terms, I often put examples or synonyms in braces. However, fuzzy search fails as soon as there is no white space before a keyword.
See an example here:
-
@ValSong nice workaround indeed. I feel stupid not to think about symlinking earlier. Unsurprisingly it works like a charm, as all Chromium browsers share the same JSON bookmark structure.
-
13 hours ago, deanishe said:
Vero already told you: website stats.
Ah yeah. I would argue this is not a good measure to predict the actual default browser of Alfred users (but this is a different topic).
-
2 hours ago, Vero said:
Safari and Chrome represent nearly 95% of Alfred's user base.
I wonder how Alfred measures this? Does Alfred look for what’s the default browser? What browsers are installed on the system?
-
3 minutes ago, Vero said:
If and when Edge, Brave or any browser, takes prevalence on macOS, we will consider supporting it,
Which makes it so hard for smaller, independent projects to attract user (now speaking for Opera, Brave, et al.), when really awesome apps—like Alfred—just don’t care about other browsers (even they share the same implementation!)
11 minutes ago, Vero said:provided a legitimate, supported way to search bookmarks is available for the browser.
Now, I’m actually very curious how you implemented the Chrome bookmarks plugin. Did Google provide you a “supported way” to search bookmarks with one line of code? Maybe I’m all wrong here, and you got some sweet API?
16 minutes ago, Vero said:Alfred has been around for over 10 years now, and this isn't how we work. We assess features we add to Alfred's core very carefully, so that users can trust Alfred to be reliable, stable and consistent.
I’m using Alfred only since a year, but I guess Alfred had features you needed to drop due to unforeseeable third-party events, even if you evaluated these features carefully before implementing it (which is, tbh, something all software companies do in order to operate sustainably). I mean, what happens if 1Password decides to drop their API support, even if you evaluated adding this feature carefully? Look, I’m sorry, I really don’t want to be a grumpy asshole here. But there are decisions from third-party companies that are not in Alfred’s scope, yet they do affect Alfred. I mean, things can change, and you never can prepare that.
Best
Steven
-
Hey Vero,
thanks for the suggestion. That is indeed a workaround. Yet, having full-hover titles would be still good for situations where even wide themes will truncate long titles.
-
Quote
What's not true?
This part from your previous post
Quoteunless Edge provides an official API for apps like Alfred to read its bookmarks.
Maybe the "it’s not true" was not right wording for this context. Rather I mean your statement is bogus.
- What do you even mean by Edge should provide an API?
- Does Chrome provide an API?
Maybe I’m not clear here, the bookmarks file (for all chromium-based browsers) is a plain text file (just open it in an editor and you will see some beautiful JSON). So what API do you expect from any chromium-based browser vendor to offer? It is basically about opening a JSON file and parse the contents. It is already structured data...
13 hours ago, deanishe said:In theory, sure, but it's not just a question of how hard it is to implement. Built-in features are basically permanent commitments.
...
Yeah thats software development. Plus, I don’t see this as a big commitment. All browsers follow the JSON-bookmarks structure from Chromium. I see this a sustainable move to support a wide range of browser which share the same standardized format to store the bookmarks.
13 hours ago, deanishe said:The Alfred team can't just drop Edge support again if it starts storing its bookmarks differently to Chromium.
Of course they can. Why not. Dropping features due to unexpected third-party behavior is not uncommon.
13 hours ago, deanishe said:That's a big commitment for a browser that's only used by a tiny fraction of Alfred users, especially when you can already use a workflow.
I don’t know about the stats (no doubt that Chrome by far the leading the field). Yet, it would just be a good (moral) move from Alfred to support other browsers that are not Apple or Google (actually looking for some Firefox love here as well).
-
Dear Alfred Devs,
I primarily fell in love with the snippet functionality. As I work a lot with ffmpeg I stored some often used commands as snippets. I also use the Name property as a place to add some useful information about a specific command (see screenshot). However, the Snippet Viewer truncates long titles if they exceed a certain width, and the Snippet Viewer indicates this behavior with an ellipsis (…). So far so good. However, a common UX feature is that truncated text reveals its full content when the mouse hovers over it (aka tooltip/title).
This not yet the case, and my notes are hidden after the truncation …
Thank you for considering.
-
On 1/21/2020 at 4:27 PM, deanishe said:
I'd say that it's extremely unlikely that Alfred will gain built-in support for Edge unless Edge provides an official API for apps like Alfred to read its bookmarks.
You would probably be better served with a workflow instead. Depending on how Chromium-like it is, a workflow like this one might be able to read its bookmarks.
Thats completely not true. Chromium-Edge uses the exact same bookmarks file structure and has the same internal workings as in Chromium/Chrome (regarding the bookmark management). I actually authored this functionality for a Windows Launcher application (Flow Launcher) to add Edge support for that software:
https://github.com/Flow-Launcher/Flow.Launcher/pull/121
The Code change I did was basically just some string replacements to get the path right (easy PR). Everything else was copy/paste from the existing chrome implementation.
The bookmarks file is located at:
Chrome
~/Library/Application\ Support/Google/Chrome/Default
Edge
~/Library/Application\ Support/Microsoft Edge/Default
Here you can see the matching folder contents (top is edge), bottom is chrome (along with the highlighted bookmarks file)
What that means; Alfred could actually support much more browsers (basically all Chromium (web browser) - Wikipedia). The bookmarks structure is in the Chromium project, it is and not something Chrome did uniquely.
So, supporting other chromium-based browsers is an easy addition to the code base. Please Alfred, it is time for some search-and-replace-work to add this feature!
Thanks ❤️
Default Icon when path does not match
in Workflow Help & Questions
Posted · Edited by vitor
Removed initial happy exclamation, which despite being used in a positive manner, contained an expletive
I was not seeing this! blindspot. thank you!