Jump to content

Floating.Point

Member
  • Posts

    124
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Floating.Point

  1. I often use List Filters to build a little menu of options. Then I feed the List Filter into a Conditional, so that each option can brach off in the workflow. It would be nice if there was a new node, that combined these two nodes together.

     

    Think of this as either

    - a Conditional you can pick from, or 

    - a List Filter with node outputs for each item.

     

    Here is a brief video explaining the concept

     

  2. Sometimes when dragging files out of Alfred, the Alfred window obscures the destination. 

    It would be nice if there was an option to hide the Alfred window on file drag.

     

    Alternatively, a more advanced solution would be this:

    When the drag is initiated, the Alfred window becomes transparent to the mouse and its visible opacity is also reduced.  This would allow us to drop the files underneath Alfred.

     

    Thanks for your consideration 😊 

  3. Thank you Vitor

     

    I believe I have now successfully adjusted the workflow to remain compliant with the Alfred Gallery. To do this I changed the Run Script's language from usr/bin/python3 to /bin/zsh--no-res and am now calling an external Python script via the following command:

    python3 emoji_to_png.py "$glyph" "$output"

     

    If I am not mistaken, this should allow you to add Homebrew dependencies through the gallery.

     

    I have released another pre-release, and with your blessing I will release as 'latest' so we can get it into the gallery.

     

    Finally, here is an additional screenshot to add to the gallery page, demonstrating the added functionality.

     

    image.thumb.png.91a38ba4f82f863550a84fea791a0b43.png

  4. I have updated Icon Generator to support emoji. Alfred will detect if an emoji has been picked and then use the Python module Pillow to generate the icon.

     

    To get this working I needed to install Pillow into Alfred's default Python (/usr/bin/python3) via the following command:

    /usr/bin/pip3 install Pillow

     

    @vitor Sorry to ping you directly, but I am not sure how best to deal with this regarding the  Alfred Gallery.

     

    I have 2 ideas about how to handle this gracefully.

     

    1) Include some kind of error handling in Python which pipes back into Alfred, alerting the user they are missing the new dependency.

     

    2) Somehow include the actual Pillow module itself inside the workflow, so the user doesn't even need to think about it.

     

    But I'm not sure which way to go? or is there a better way to handle this.

     

    Otherwise, the updated workflow is really nice. It's a great enhancement. I have added it to Github as a prerelease in case you'd like to test it out.

    https://github.com/NeighNeighNeigh/Alfred_IconGenerator/releases/tag/v3.0.0-beta.1 

  5. This is working very well, thank you Vitor. The script filter took me a bit outside my comfort zone, which was a fun adventure. After implementing your fine work, I used the resource you linked and learned how script filters handle icons. Then I felt I had at least contributed something to the final solution by successfully adding in my custom icon for the 'finished tagging' entry. It's all working great!

     

    Thank you again 🙏

  6. Thanks Vitor, for jumping in on this one. 

     

    Your script filter is fantastic – successfully grabbing lines from the file to populate the menu.

    The next section is me troubleshooting as I better explain the requirement, try and deconstruct your script, and fail to integrate the required functionality.

     

    Note: There is a concise TLDR at the end.

     

    I see that .splice(1) is removing the first line. Forgive me, but in hindsight I didn't do a great job of explaining what's actually going on there.

     

    Put simply, the very first item in the menu needs to be the following (JSON):

    {\"imagefile\":\"myicon.png\",\"title\":\"Finished tagging\",\"arg\":\"Done\",\"subtitle\":\"{var:displayTags}\"}  

    (which I extracted from the original List Filter using Alfred's 'Copy Configuration' tool (A trick I learned from you 😊

     

    Attempting to deconstruct your script and implement the above, I have first removed the .splice(1) line as it is not needed.

    Next I can see that the final line seems to be populating something called 'items'. I recognise that from the JSON that came out of the 'Copy Configuration' of the List Filter. So my instinct is that I just need to add my custom line of JSON to 'items' before the 'sfItems' constant is fed into it…

     

    // Correct path between the quotes
    const filePath = $("/Users/nathan/Documents/Notes/Databases/References/Metadata/Tag List.md").stringByExpandingTildeInPath.js
    
    // Leave unchanged from here
    const fileData = $.NSFileManager.defaultManager.contentsAtPath(filePath)
    const fileContents = $.NSString.alloc.initWithDataEncoding(fileData, $.NSUTF8StringEncoding).js
    
    const sfItems = fileContents
      .split("\n")
      .map(item => ({ title: item, arg: item }))
    
    JSON.stringify({ items: {\"imagefile\":\"myicon.png\",\"title\":\"Finished tagging\",\"arg\":\"Done\",\"subtitle\":\"{var:displayTags}\"}, sfItems })

    Sadly, this throws the following error: syntaxError: Invalid escape in identifier: '\' (-2700) 

     

    So now I've been hacking away trying to resolve the syntax error.

     

    I've tried wrapping it in quotes like so:

    JSON.stringify({ items: "{\"imagefile\":\"myicon.png\",\"title\":\"Finished tagging\",\"arg\":\"Done\",\"subtitle\":\"{var:displayTags}\"}," sfItems })

     result: SyntaxError: Unexpected identifier 'sfItems'. Expected '}' to end an object literal. (-2700)

     

    Tried removing all the escaping and keeping it in quotes:

    JSON.stringify({ items: "{imagefile:myicon.png,title:Finished tagging,arg:Done,subtitle:{var:displayTags}}," sfItems })

    result: Same error as above

     

    I've tried these, among other fruitless (likely silly) attempts, and don't really know what to try next.

     

    So again, what I'm trying to figure out is the following:

     

    TLDR

    The first entry in the list needs to use the following JSON (I extracted with the 'copy configuration' tool). All other entries are populated from the text file.

    {\"imagefile\":\"myicon.png\",\"title\":\"Finished tagging\",\"arg\":\"Done\",\"subtitle\":\"{var:displayTags}\"}  

     

    Thanks for your tuition and patience, it's insanely helpful!

  7. Could you take a screen recording of the whole process you are trying to automate? Then it will be possible to help come up with an automation. Usually anything is possible with Alfred, it's just a matter of how hacky / elegant the end result ends up being. 
     

    otherwise check out UI Vision RPA

    which could work with an Alfred workflow to handle the in browser stuff

     

     

  8. Hello,

     

    Im building a little system that allows me to select several items from a list filter and add them as text to a file.


    it’s working pretty well, and looping through the list filter several times is actually a pretty neat way to use Alfred.

     

    https://github.com/NeighNeighNeigh/Alfred_TagsFromList/raw/main/Loop - Select multiple options from a list filter.alfredworkflow
     

    What I need to do now is populate the list filter at runtime with the contents of an external plain text file.

    for example my tags.txt file might look like this

     

    tag1

    tag2

    tag3


    and each line would become a new entry in the list filter (used for both ‘title’ and ‘arg’)

     

    What’s more is there’s one entry at the top of my list filter that isn’t taken from the external file, and it contains data in the fields ‘title’, ‘subtitle’, and ‘arg’. When selected, this entry is used to finish cycling through the loop (see the linked workflow)


    I know that I can use the json node to feed the list filter, but I’m not sure how to convert each line from the source text file into the correctly formatted entries within the json syntax.

     

    Would anyone be able to help me work this out? 

  9. Oooh, okay I'm onto something! 

    The 'Call External Trigger' and the 'External Trigger' nodes can be used to make a loop.

    So now I have this, which seems to be working really well.

    image.gif.4bfa38ef23a602848f2a645eb8fe8126.gif

     

    Menu pops up asking which tags to add. The first menu item is 'Finished tagging' (which also displays a log of all previously added tags)

     

    SCR-20230803-ngka.thumb.png.2281552c50071137fa9da7058a2ef06d.png

  10. Howdy, Im wondering if anyone have a trick for selecting multiple items from a list filter?

     

    For this part of my workflow, I am trying to automate adding some content to a text file. I want to use the list filter to display a list of potential strings from which multiple could be picked.  

     

    Since there is no way in the Alfred UI to pick multiple list items, I thought there might be some way to loop back to the same list filter and make subsequent selections, each time somehow adding to a variable. But quickly I learned that I could not wire up Alfred's noodles to ouroboros in this way.

     

    So now I am a bit stuck and if anyone has a moment to spare it would be appreciated!

  11. Pin Plus seems to have broken for me. Maybe with my recent update to macOS 13.1 (I was on macOS 12 until a few days ago).

     

    I tried updating to the latest version 2022.3 (updated through user gallery) 

     

    My Safari is configured with:

    ✔ Allow JavaScript from Apple Events

     

    With Safari frontmost, when I attempt a "PA" action, nothing happens and I get the following in Alfred's debugger:
     

    [02:26:52.072] Pin Plus[Hotkey] Processing complete
    [02:26:52.079] Pin Plus[Hotkey] Passing output '' to Run Script
    [02:26:52.420] Pin Plus[Run Script] Processing complete
    [02:26:52.426] Pin Plus[Run Script] Passing output 'null
    ' to Run Script
    [02:26:56.978] Pin Plus[Keyword] Processing complete
    [02:26:56.987] Pin Plus[Keyword] Passing output '' to Run Script
    [02:26:57.306] Pin Plus[Run Script] Processing complete
    [02:26:57.312] Pin Plus[Run Script] Passing output 'null
    ' to Run Script

     

    "PIN" and "PUN" keywords seem to be working fine, its just "PA" that's no longer working.

  12. I'm not sure if this is a feature request or a help request. This may in fact already be possible (hopefully?)

     

    The short of it:

    I want to "Pull" file buffer objects into a directory that I have selected using full-Alfred (rather than the limited search and browse mode used when actioning the file buffer ordinarily)

     

    The long of it:

    I have a few hotkeys set up to browse Alfred at a specific location. Using these hotkeys allows me to instantly get Alfred to my most common working directories. This navigation approach does not play nicely with the file buffer. The file buffer works with a kind of "Push" methodology, where you must choose the type of action (copy move whatever) and then select the destination for the operation. The way one chooses the destination is a limited subset of Alfreds capability. I can't use Alfred full capabilities to find the destination.

     

    What is needed is a kind of "Pull" based solution, where one can have a bunch of files on the buffer, then use their existing methods of navigating Alfred to select a folder, and then action the buffer using this folder as the destination.

     

    Basically just need some file actions like "move buffer contents here" / "copy buffer contents here" 

     

×
×
  • Create New...