Jump to content

Jasondm007

Member
  • Posts

    342
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Jasondm007

  1. @vitor Thanks for letting me know about the uid component of that script! As always, you were correct that I merely needed to remove it to get Alfred to stop "learning" from past selections (and everything still works perfectly fine). As for your feelings and @deanishe's about AppleScript, I certainly don't disagree. At some point, I'd like to take up python. Unfortunately, at the moment, I just don't have the time or skillset to take up a new language (beyond the limited tinkering that I currently do). As always, thanks for your support everything! Happy Holidays!
  2. @dfay, @vitor & @deanishe - I've been tinkering around quite a bit with my old workflows have updated some of them with script filters. For the most part, everything seems to working great! I really like the flexibility they provide over other fixed lists, etc. However, I have three small questions that I was hoping to bounce off you. 1 - The first question has to do with how to manually add items to the script filter's output. Building on the previous example - which contained a list with the colors Red, Green, and Blue - let's say that I want to manually add options for the colors Yellow and Orange (i.e., they're not in the original list). As shown below in the script filter's code bold, do you just add them after the repeat loop? This seems to work fine, but I wanted to make sure I wasn't going to break anything. 2 - If I wanted to give the Yellow and Orange items their own icons, how would I specify that? Assume that the workflow's folder contains an image for each ("iconyellow.png" and "iconorange.png"). The approach below does not work (shown in bold). The output just displays the usual icon for the workflow ("icon.png"). Based on feedback from other posts (e.g., Post 1, Post 2), I've tried several permutations of this approach, but I haven't had any luck thus far. You can download the script filter shown below with icons here: Download In case its helpful, here's what the script filter's output looks like in the debugger. As you can see, the icons' paths appear to have a different kind of bracket around them. 3 - Lastly, is there any way to stop Alfred from "learning" while using a script filter? In other words, is possible to make Alfred spit out the results in the way you have them sorted? Thanks again for all of your help!
  3. @sballin That's awesome! I had no idea you could do that with file URLs, more generally. Thanks a ton!!
  4. @sballin I'm still a religious user of your workflow!!! Quick Question: Is it possible to create an "alias" for a note that Finder can use, like it does for other files? You created that awesome URL handler, which allows people obtain links for specific notes, like URLs. And, I use it a lot when inserting cross references. Sometimes when looking at projects in Finder folders, however, I forgot that I also have a note in the Notes app that's relevant. As a result, I was hoping to add an alias in Finder that would link to the note (i.e., using the Notes://blahblahblah). Is this possible? As a always, thanks for your help!!
  5. Christmas Wish for Alfred: I wish users had some control over the size of the left panel in Alfred's Preferences (not the sidebar, but the panel next to it). As shown below, I'd like to be able to drag the panel right - at times, when viewing my Workflows - as the current fixed version doesn't allow users to see much of their workflows' names. Personally, I keep a lot of resources to use as examples for building or modifying new workflows, but it's impossible to see their titles or descriptions under the current space allotment (i.e., even if I went to a less ridiculous naming convention).šŸ˜€ Thanks for your consideration!
  6. @GuiBThanks again for the helpful explanation! You're definitely correct about my mistake usually being related to confusion about how Alfred does/not pass variables (re: strings, etc.). Some days it feels like the bane of my existence šŸ¤¦ā€ā™‚ļø Ha Thanks again for all of your help with everything! Happy Holidays!
  7. @GuiB Thanks a ton for taking the time out to take a look at this for me. Your explanation and this working example is incredibly helpful. Much appreciated. By chance do you have any recommendations for how to test for these types of variable-related problems? I use the debugger and often create intermediate steps where I copy a variable to the clipboard, so that I can make sure that everything looks OK. However, these problems drive my crazy!! šŸ¤Ŗ Thanks again!!
  8. @GuiB I was wondering if I could ask a quick question related to our previous discussion/working examples above? More specifically, I occasionally have issues when trying to use your working example to connect a File Action to Run Script set as an AppleScript. Namely, the script often only runs on the first file selected and not the others. For example, this morning I was trying to create a quick workflow that will work for multiple selections at a time with a (1) a keyword through Finder, and (2) a file action. The workflow merely places the files on the clipboard as images (I have one app in particular that is a little finicky about pasting things). In any case, it works perfectly from the keyword for multiple selections. However, it only works for the first selection when run from a file action. It's virtually identical to your working example (which moved files to the user's downloads folder). I've highlighted the only real difference below: Any ideas what might be causing the problem? Does the text from the file action have to be processed before being handed off? I tried creating another step after the file action, so that I could try and get the list of files to look identical to the list that is handed off by the keyword-based version, but I was never quite able to get it to work for multiple selections at a time. I've uploaded the workflow here: Download Workflow Hope this finds you well. Thanks for any help you can lend!
  9. @dfay, @vitor & @deanishe - Thanks for taking the time out to help a coding neophyte, like myself. I really appreciate it. Honestly, I can't thank you guys enough. Alfred's great, but it wouldn't be the first thing I'd install on a Mac, if it weren't for you guys and others on the forum. I've learned a ton from you guys! For others who may be struggling with script filters and JSON outputs, I've uploaded a new version of the workflow to use as a learning example: Download Workflow. The workflow combines everyone's suggestions from above: AppleScript, JavaScript & Ruby. All three are nearly identical, with the exception that the JavaScript and Ruby versions lack the prefix "Same Words" in the subtitle. This should be enough to get you started, if you're also struggling to get your head around how script filters' outputs work.
  10. @vitor Thanks a ton for the explanation and the two working examples. This was extremely helpful, and it got me thinking that I could probably figure out a way to use my existing AppleScript to generate the list and then feed it into your JavaScript or Ruby script filter examples? It's a pretty complicated AppleScript - for my scripting ability, anyways - that generates the list. To be sure, I don't disagree with any of your statements - or others' on this forum - about AppleScript's šŸ’© status. But it would take me ages to learn one of these better languages, and then reverse engineer the existing AppleScript. As you can tell, I hardly understand AppleScript šŸ˜‰ @dfay Thanks for the sources above! One of the first failed variations that I mentioned above came from my hackneyed attempts at pulling out pieces of your windows workflow (the one that works for Preview and a few others apps). When @deanishe mentioned a json.scpt file, I knew that I had seen one in your workflow, so I used it in several iterations. But I could never get any of them to work. However, I completely forgot about your more streamlined workflows for only Preview and Finder. In the multi-app version, I think stringing all those variables together for the different apps got me a little turned around. In any case, I'll go back and take a look at those other versions. Thanks a ton!! I can't thank you both enough!!
  11. Or, relatedly, does anyone know of another workflow they could point me to that uses a script filter in a similar fashion (i.e., another good learning example)? Thanks again!
  12. I have a very basic question about how script filters work that I havenā€™t been able to find a direct answer to on this forum or on Alfredā€™s support page. To be fair, thereā€™s a ton of fantastic information on both, but I simply havenā€™t found one dumbs its explanation down enough for me to follow it. I've been using Alfred for quite some time, but have never been able to understand much about script filters. In short, I was wondering how to get items from an AppleScript list to show up as JSON formatted items in a script filterā€™s output (so that I can select one of them, and have it operate like the argument in a subsequent object)? For simplicity, letā€™s say I have an AppleScript that generates the following list: {"Red", "Green", "Blueā€} But, in practice, that list will be dynamically produced and longer. In other words, I can't get away with just manually listing each item in the script filter (like in Alfred's jsonformat workflow example: Getting Started/Script Filter). Based on this example, how do I get the script filterā€™s output to operate like the following? Item 1 Title: Red SubTitle: Same Words Red Argument: Red Item 2 Title: Green SubTitle: Same Words Green Argument: Green Item 3 Title: Blue SubTitle: Same Words Blue Argument: Blue To illustrate, hereā€™s what the output might look like when created with a list filter: *** @deanishe, I tried following your helpful advice and added a json.scpt file from another workflow that also used this approach. However, I couldnā€™t quite figure it out. Is there any way that I could talk you - or anyone else - into walking me through this, using the following example? šŸ™ Based on the example above, Iā€™ve created a very basic workflow to help illustrate things (for myself and others): Download Workflow. The workflow contains: (1) a script filter and (2) a list filter. The script filter has been stripped down to a single line of code that sets a variable to the afore mentioned list above (set theList to {"Red", "Green", "Blue"}) (AppleScript). In other words, I removed all of my failed attempts, and have only included this line in the AppleScript as a starting point (I understand thereā€™s more to be done here). As for the list filter, it was included to illustrate how Iā€™d like the script filter to perform (i.e., its output). I understand that if the string/list was fixed, that I could always just use it (instead of a script filter). Again, this was added strictly for illustrative purposes. To keep things simple, both filters simply copy their output to the clipboard. So, if you select the ā€œGreenā€ item from Alfredā€™s output, it would copy the word ā€œGreenā€ to the clipboard. In practice, this would be connected to another object that would do something else with the variable. But this struck me as an easiest way to test things. Can someone help walk me through how to set up the script filter so that it operates like the list filter (using an applescript list of variables)? Thanks in advance for any help you can lend! I really appreciate it.
  13. @sballin The update works like a charm on my machine, too. You're the best! Thanks a ton!!
  14. @sballin Yeah, on my system, it's only located in: /System/Applications
  15. @sballin I'm not sure if this is what you're asking, but when I run your workflow and it shows the search results, I see the workflow's icon next to each note (i.e., not the default Notes.app icon or anything else). Hope this helps!
  16. @sballin I'm not sure if it's helpful, but here's the path to the Notes app: /System/Applications/Notes.app
  17. @sballin Thanks for your help! Omitting the initial lines from the debug log, here's where the error occurs: ... ... [14:35:44.266] Notes - Search [Script Filter] Processing complete [14:35:44.282] Notes - Search [Script Filter] Passing output 'x-coredata://BC2A1C56-125D-4468-A9F8-D42448AC3262/ICNote/p3639' to Run NSAppleScript [14:35:44.439] ERROR: Notes - Search [Run NSAppleScript] { NSAppleScriptErrorAppName = Notes; NSAppleScriptErrorBriefMessage = "AppleEvent handler failed."; NSAppleScriptErrorMessage = "Notes got an error: AppleEvent handler failed."; NSAppleScriptErrorNumber = "-10000"; NSAppleScriptErrorRange = "NSRange: {67, 20}"; } Thanks again!
  18. @sballin Since updating to Catalina last evening, I'm still able to search for everything using your fantastic workflow. However, when I select the note that I want to open from Alfred, the workflow won't open it. The workflow looks like it's working as usual, but nothing happens. I noticed that there is a "Note Opener" app in the workflow. Is this the usual "unidentified developer" problem with Catalina? Unlike other workflows that had this issue, I did not receive the usual error indicating that it was trying to run an app from an identified developer. Any ideas what might be causing the problem? Others above seem to be OK since updating to Catalina (or at least one of the betas). Your workflow is one of my favorites on Alfred!! Thanks for your help!
  19. In Alfred's "File Search" preferences panel, it'd be helpful if the butler added a "Don't Show" option for Videos. He's already got an option for "music", how about videos, too? And, if that's not a possibility, how about a general exclusions panel where users can drop in anything that they might want to exclude, such as MP4s, Excel files, etc. Thanks for your consideration!
  20. My apologies @Andrew, I should have been a little more clear. I was asking whether the fantastic new * method for finding matches across multiple fields - as you've shown in the screenshot above, with the metadata field set to * - is limited to searching the nine default fields provided in the file filter or whether Alfred's actually searching all metadata fields on our system (e.g., kMDItemTextContent, kMDItemFSName, and all else)? Thanks again!
  21. @Andrew Thanks for making this update! It's super helpful!! Quick Question: Is it searching all available metadata fields or just the usual nine fields listed in Alfred's dropdown? Thanks! As for the improvements you alluded to above, is there any way this will include the ability to limit/specify the metadata fields? šŸ˜€šŸ¤ž Alfred rocks! Thanks again, @Andrew!
  22. @deanishe Agreed - it's just a problem in Alfred's preferences, as described above. And, to be clear, it's a relatively minor UX problem in the scheme of things. For the most part, I really like Alfred 4's new look. While the point about dark themes and usability across light and dark themes is fair, it's odd to rule out the use of dark iconography now in Alfred's preferences. Ignoring Alfred's longstanding use of gray/light backgrounds and black typography, there are a lot of people with vision-related issues that depend on white/gray/light backgrounds and dark text/icons for legibility purposes. Not to mention the fact that Alfred's own icon is hardly visible in the settings described above. Take a look at the screenshots below. Why create visibility constraints that even the app's own icon doesn't work well under?
  23. Iā€™ve posted this as a bug but, in fairness, itā€™s a feature of Alfred 4 (and not a bug). Namely, some aspects of Alfred 4ā€™s new GUI are too dark to be legible in some use cases - particularly for those who use dark iconography. In the workflows section of Alfredā€™s Preferences, this problem manifests itself where the icons are displayed in the inner sidebar and in the informational portion at the top of the window. In the screenshots below, note how difficult it is to see the black search / magnifying glass icon? For me, itā€™s more of a functionality problem than an issue of aesthetics, as I rely on the sidebar icons to quickly find the workflow Iā€™m looking for. While the text looks good, unfortunately, the icons are no longer visible in Alfred 4. Workflows - Sidebar Workflows - Informational Portion (top of screen) The second place where this issue comes up in Alfredā€™s Preferences is when viewing Snippets. While this problem also involves the use of black iconography - for snippet Collections, specifically - itā€™s only visible to those who use MacOS in dark mode (but use a light Alfred theme). In these cases, the background color behind the collectionsā€™ windows is dark, making black icons impossible to see (see screenshot below). Features - Snippets - Collections Window There are a ton of ways these issues can be fixed, so I thought I'd throw out a few: Easiest fix: use lighter background colors in these cases (e.g., flipping the two purple colors in the sidebar, so the dark is on the outside) (e.g., going with a lighter gray/black in the upper information) Another fix: add another display option with a lighter color, such as those accessed via the gear next to Alfred's workflow filter (screenshot below). However, something else would have to be done about the snippets/collections problem, since it lacks such options. My favorite fix: add a color palette option to Alfred's main preferences. Personally, I like OmniFocus' approach, which provides users with three options for: automatic, light, and dark modes (see screenshot below - they call the "light" version, just plain old OmniFocus). Here, the automatic mode would just follow the MacOS designation, and the others would allow users to manually place Alfred in either mode. Among other things, this would entail creating a light mode - or in keeping with OmniFocus, just a plain old "Alfred" mode - where the issues outlined above are easier to see (in addition to maintaining the lighter toolbar, which Alfred already does when MacOS is not in dark mode). Thanks for your consideration!
×
×
  • Create New...