Jump to content

Kalaschnik

Member
  • Posts

    19
  • Joined

  • Last visited

Posts posted by Kalaschnik

  1. 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:

    image.thumb.png.d1600b828d2907f8da5b974ef4fd6d96.png

     

    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

  2. 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?

  3. 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:

    SikNR.gif

    (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?

  4. I started to use Alfred to open Website with a predefined browser:

    image.thumb.png.4ffbae5267ffc2cbc4c6c7f6fecaa0e1.png

     

    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?

  5. 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

     

     

  6. Quote

    What's not true?

     

    This part from your previous post

    Quote

    unless 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). 

  7. 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.

     

    1211173418_ScreenShot2021-02-05at18_32_54.thumb.png.6fcc99e38fbf1ffc79fcada4231b97c0.png

     

     

  8. 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)

     

    1325204498_ScreenShot2021-02-05at18_55_55.thumb.png.65a2991d9936b54e66f5f96c8c00562f.png

     

    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 ❤️

×
×
  • Create New...