Jump to content

Smpl

Member
  • Posts

    41
  • Joined

  • Last visited

Posts posted by Smpl

  1. While a "cool" idea; would be a bit cumbersome. since the coding needed to execute the "workflow" is within the Alfred application itself. And packaging applications for macOS isn't just a click-n-done process.


    The workflow would have to be packaged as a standalone application that would require separate Xcode to be able to run independently, and have security permissions (like monitoring the keyboard for the hotkey, file permissions, etc) .. There is software on Windows that can do that, like AutoHot key, creating a .exe (executable) but that mostly in part to the fact that Windows is not as secure, and lets applications/software have free range to what it can access on a person computer. And AHK is such a lightweight program to begin with, when it creates those "exe" its bundling a large part of the AHK code within it, and uses a config file to perform the users define actions/flow.

     

    You could probably just find a way to build the "workflow" in Apple's Shortcut app, then share that.. since Shortcuts is preinstalled since like macOS Monteray.

    Additionally, there is the built in application "Automator" which supports workflows, folder actions, applications, etc.

  2. 11 hours ago, vitor said:

     

    Tell the Conditional to matches regex and use ^!b as the match (i.e. text starting with !b). Then use a Replace Utility (again matching regex) to replace ^.*? (there’s a space at the end) with nothing. I.e. it deletes everything from the start of the text until—and including—the first space).

     

    This is sounding a lot like an XY problem, though. To get proper help describe what the final result is supposed to be instead of the steps you’re envisioning to get there. It’s likely there are better approaches for what you want.

     

    @vitor I'm just trying to create a workflow that will let me append/prefix certain things to selected text using keyword function in alfred.
    I don't like hotkeys, my main reason for getting Alfred was to avoid Hotkeys as much as possible because I don't like having to remember them..

     

    for work, we use a lot of markdown formatting, so I want to be able to Highlight some text (wherever) and then prefix/append that text with the correct markdown formatting.
    And eventually do the same with selected text on multiple lines, as I often have to copy a list from an excel sheet, which then I have to manually go line by line adding the * in front of each line to get the bullet markdown format for a list. 

     

    Unfortunately, even with Alfred 5, we are limited to only getting selected text using a hotkey. So I've set the 1 hotkey in the workflow to be the same as hotkey that calls Alfred (Opt + Space) ..

  3. I'm not sure if "arguments" is the correct term to use here.. so I'm just going to explain.

     

    I want to use the "conditional" block in the work flow, but I want the condition to look at the first "part" of the input in the Alfred text box.

     

    For example: if I have "!b What time is it" in the Alfred input box, I want the conditional to look at the "!b" part to know where to go next, but pass through the "What time is it" part.

    This become tricker when I have multiple lines 
    Example:

    "!b What time does the movie start
    where is the move theater
    how much is the popcorn?"

  4. On 6/10/2021 at 1:26 PM, elnadav12 said:

    Here's one for all you beta testers.

    Alfred trigger a Siri Shortcuts workflow to play Apple Music song.

    Have fun :)

    1336637917_ScreenShot2021-06-10at21_24_40.thumb.png.57193d3c0f347f8829bfceaf17144854.png

     

    Edit: Totally didn't realize this post was over a year old.. say the 06/10 but brain ignored the "2021" part 🤷🏻‍♂️ .. Oh well.. at least what's below could be useful to someone out there..

     

    You don't need to "Get Clipboard" 

    image.thumb.png.92f1af38c4b2eeaf73ac123d180ed9a8.png

    Additionally, if you update to Alfred 5. You can actually send an Input As String to the Shortcut - So you don't even need to use the clipboard

  5. 7 hours ago, Vero said:

    @Smpl Yes, apps are cached to return results as quickly as possible, so once you've removed the Core Services path, type "reload" into Alfred to refresh the app cache. :)

     

    Doesn't seem to work properly...

    Now this one is showing up after doing the reload.. 
    image.thumb.png.748a52d521238bd3e957b387cfa12b1c.png

  6. So I'm trying to remove some useless results from Alfred when searching.. wish there was a blacklist to prevent certain things from showing up, but for whatever reason that doesn't seem to be possible.. 

     

    So in the "Search Scope" there was an entry for  /System/Library/CoreServices/Applications that I removed.. but results from that location are still showing up when searching in Alfred. 

    image.thumb.png.5d5b597ffe296602900b937b4f6246cf.png

     

    How do I make these results go away? is there some sort of cache going on? If so, how do I clear it?

     

    If I need to launch an app, I would just use spotlight.. I use Alfred for the things Spotlight can't do, not as a replacement. 

  7. I have a workflow I'm working on that has a List Filter that is then passed to a conditional, but when I select an item from the List filter the argument from that List remains in the Alfred box. How can I have it so that after a selection is made from a List Filter, the argument doesn't stay in the Alfred box?

     

    Reason being, is that after the conditional, some of the flows have another list box, which I then have to manual delete (backspace) the argument from the previous list before the options in the new List Filter will appear.

     

    Demo Workflow https://send.tresorit.com/a#zAXymmxDDj_Yr9roUyqq5g

    just type cleartest, ENTER, select "Item 1" from list, and notice item1 appears in the Alfred box. How do you auto delete/remove "item1"

     

    Edit: So the only way I've figured out how to do it, is to dump the output of the List Filter into a dummy Arg to Var  or use the Replace and just leave the output blank.
    Is there no better way to do this without the need of another item in the workflow?

  8. On 3/15/2022 at 8:35 AM, gohoyer said:

    Could you try to export the json file from Rectangle and use the  "Manage Settings" option from the workflow  to inform the json location?

     

    To note: the "Manage Settings" part of the workflow does appear to function. I enter the path to the .json and it does nothing when pressing enter.

    Will also note; that I copied the "RectangleConfig.json" file to the /Users/{user}/Library/Application Support/Alfred/Workflow Data folder first, to see if the workflow would use it, but it did not.

     

    I manually added the path using the variable button (top right) of the Alfred Preferences window. And now it seems to be working. 

     

    I removed/delete the work flow, just to test, and upon adding it back again its not seeing that .json in the Workflow Data folder. Only works again after I manually add the value to the variable 

     

    Heads up; your workflow uses python, which has been removed from macOS 12.3 by Apple.

  9. 6 hours ago, vitor said:

    This may be what you want:

     

    const music = Application("Music");
    
    const playlistItems = music.playlists.name().map(playlist => {
      return {
        "uid": playlist,
        "title": playlist,
        "arg": playlist
      }
    })
    
    JSON.stringify({ "items": playlistItems })

     

     

    Thanks, this works pretty well! However it only lets me select one of the 'results' from the script filter list either by pressing enter on it or the ⌘{number} keyboard shortcuts or by arrowing down then pressing enter. I'm not able to like start typing the name of the playlist

     

    Edit: Actually I think I got it; I checked "Alfred filters results" which seems to have fixed the not being able to type the playlist name. Not sure if that is the correct or only way to make that work.

     

  10. var music = Application('Music');
    music.activate();
    
    music.playlists.name();

     

    well derp; looks like I figured it out. I swear I tried this hours ago and it didn't work 🤦🏼‍♂️

     

    Now I have absolutely no clue about JSON

     

    ["Library", "Music", "Music Videos", "My Top Rated", "Recently Played", "Alfred Playlist", "Breakup Songs", "Cruise Control", "Electronica", "Folk Music", "Gaming", "Hip Hop", "Kuntry", "My Shared List", "Megans List", "Private Songs", "Work Out", "YouTube Sync"]

     

    This is what is outputted in the Results of Script Editor using the JXA (JavaScript) code above.

     

    Could really use the help here on how to convert this list to a JSON, or at least point me to some documentation on it and I'll try to figure out. But I've never used JSON before.

  11. var music = Application('Music');
    music.activate();
    
    music.currentPlaylist.name();

     

    I've been trying to learn a bit here; Stating from scratch basically. 

     

    I'm able to get the name of the playlist that is currently playing in Apple Music, but have yet to figure out how to get a list of all playlists like you can with the AppleScript in the  first post.

    There are 3 options userPlaylist, LibraryPlaylist, SubscriptionPlaylist oh and FolderPlaylist but I haven't figure out how to use those yet. :(

     

    Pressing onward..

  12. 8 hours ago, vitor said:


    No, this one is fine. “One problem at a time” is what matters.
     

    What exactly is the new question? What’s your current setup and what result are you trying to achieve?

     

    I did end up create a new topic Help with getting output from AppleScript to JSON

     

    Problem is, I'm not a "programmer." So I'm not familiar with how to change the AppleScript to this JXA you mentioned before to interact with the Apple Music apple.
    I spent several hours googling how JXA/JavaScript could be able to control/obtain data from Music but there was nothing on this subject. Some smart individual needs to come up with a program that lets you input AppleScript, and it outputs JXA, lol.. I'd pay for that :P 

     

    Basically what I'm trying to do is dynamically get a list of my Playlists in Apple Music, then output that to the AppleScript I have to play that playlist.
    Its not super important or vital that its possible, I just wanted to be able to share my workflow and the friends that use it wouldn't have to Manually edit the List Filter with their Playlist titles like I have. I personally don't mind having to do that, just thought it would be easier for others if the workflow did it for them.

     

    Edit: I got the JXA (JavaScript) part of it figure out through trial and error, and looking through the Dictionary in Script Editor, but I'm stuck on the JSON part. I've posted the code I'm using in the other topic, where I've been having a conversation with myself :P

     

     

  13. 29 minutes ago, vitor said:

    But again, that has nothing to do with the original question. If you start with a simple query and then introduce an unrelated complex one midway through, it won’t be easy to help you.

     

    @vitor I just thought it would be better to use the same topic, since its related to the same workflow. Instead of starting a whole new one.

    I'm good with the original question, I'm fine with how it is now. I didn't realize that the workflow window expands to allow for more space, so I was originally trying to see if there was a simpler way to get to the same end result to save on space in the work flow since I knew I had more to add.

     

    If its better than I create a new Topic for the Script Filter question (or whatever is needed to be used instead) to obtain the playlists automatically from the Music app, then I will.

     

    Thank you for the help thus far though :)

  14. 1 hour ago, vitor said:

    What is the purpose of the Keyword? You can start the Workflow with the List Filter itself and the behaviour would be the same. Better, even, because it would ensure you only type valid options and wouldn’t need to use the full word.

     

    That is true; but I don't mind typing full words. I type pretty fast, and most words are only a few letters any ways.

    But I put the keyword in, because it hides the annoy google search from the list filter. However I did add a shortened keyword on the List Filter (am) to jump right into that if needed (but again with the annoying google search at the bottom of the list)

     

    1212812921_ScreenShot2022-03-08at7_17_48AM.thumb.png.af55756bc4549b12508392803985becb.png

     

    But I added a Playlist option to the flow, but have to manually add the playlist names to the List Filter.

    Is it possible to get the playlist using the Script Filter?

     

    I tried using 

    tell application "Music"
      get name of playlists
    end tell

     

    But don't know how it outputs the results, or what I need to output them to? 

     

  15. This doesn't seem to be working, at least not for me. 

     

    For example if I do rct>maximize when I'm in Apple Notes, it just creates a new line in the note I'm working on

    Or if do the same when Finder is the top app, it just makes a bonk noise.

     

    All my Rectangle shortcuts are whatever the defaults are, as I've never cared to change them since I just use Rectangle for the snapping (drag to snap) function as I don't like having to remember a million keyboard shortcuts.

     

    maximize in Rectangles appears to be the combination of "⌥ ⌘ F"

     

    I looked in the /Users/{user}/Library/Application Support/Alfred/Workflow Data folder, but I don't see the mentioned "RectangleConfig.json" file that is supposedly created.

  16. On 2/23/2022 at 3:58 AM, Srisri said:

    Hi, 

     

    Can this be workflow specific ? For some searches I would like to see the path, but for some workflows I do not wish to see the path as it adds no value. And secondly while using screen recording or in a video conferencing.. i still want to search the systems using alfred but do not want others to see my path.

     

    thank. you.

    If its a workflow; edit it to remove the subtext where not wanted 🤔

  17. 1963883441_ScreenShot2022-03-07at10_49_50PM.thumb.png.6d1d37c0e16c9304201df436f1d3dc0a.png

     

    Is there an easier way to make it so that I can type the key word + the argument for the List Filter when opening Alfred?

     

    In the above, I can type "music play" and it performs the intended action/output. Or I can just type music, hit enter and get the options from the List Filter (in case I have a brain fart and forget what options are available or how I abbreviated them)

     

    Just wondering if there is another way to do this, without having to use the Conditional Filter after the initial keyword? Reason, because I'm working on another workflow that has many more end commands and need to conserve space in the workflow build window. Also just trying to learn and not over complicate things as much as possible.

     

  18. 2 hours ago, Vero said:

    @Smpl Alfred and Alfred Preferences are two separate apps, and rely on underlying file system notifications to communicate the preference changes with each other. It could be that these notifications aren't happening on your network volume setup.

     

    A more reliable solution would be to keep your files locally on your Mac, and use rsync to coordinate changes with your local server. That way, Alfred always has instant access to local preferences, even when the network volume isn't available. 

     

    Network Volume is always available.

     

    If these are "two" apps, then why did I only have to install one app? Sync setting is under Alfred>Advanced 

  19. On 3/6/2022 at 5:24 AM, Vero said:

    @Smpl The Alfred.alfredpreferences file is essentially a folder containing your preferences. The fact that the date hasn't changed on it doesn't mean it's not syncing.

     

    Which syncing service are you using?

     

    Try adding a custom search, or changing a snippet, then once your sync service has done its job, checking the Alfred preferences on your other Mac. Provided it's set up properly, you'll see the changes :)

     

     

    It only seems to be working if I close Alfred, then relaunch it. The new workflow, or changes to something are then applied after Alfred has been restarted.
    I made the change on the desktop Mac, waited about 15min for that change to show up on the MBP, but it never did... until the restart.

     

    The "syncing service" I'm using is just an in-home server rack. The Alfred docs said iCloud was not recommended, and I will not install GDrive or Dropbox on my machines. 

    So I'm just using a folder on my server, which is mounted/mapped in Finder.

×
×
  • Create New...