Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Jasondm007 last won the day on February 7

Jasondm007 had the most liked content!

About Jasondm007

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @deanishe & @vitor Yeah, I hear you. I keep trying to peck at the other languages, but have struggled. If I told you how much time I've spent on these (and other terrible) workflows, you'd laugh. As you can tell, I don't work in tech and barely understand AppleScript. Baby steps! Ha While I'm obviously not familiar with these things, I still find it somewhat surprising there isn't a better library/dictionary for AppleScript to use for purposes of JSON outputs. The one that I relied on in the example - which is also used by a lot of other Alfred workflows - hasn't been maintained for years. In fact, its creator commented a few years ago that he was surprised people were still using it. In any case, thanks to @deanishe & @vitor's help, I created another test workflow. For those who might be interested, one of the script filters allows you to play any playlists in your library and the other allows you to move a selected playlist to any playlist folders you might have created. The later is super helpful if, like me, you hate dragging things around or right-clicking a ton of times. The former runs a little slow on my machine, but that's probably more due the mess of playlists I have in my library than anything. Click here to download: https://share.getcloudapp.com/NQugBAdO PS: @deanishe I'm sorry for sending the (JavaScript) script filters to AppleScript. 🤦‍♂️
  2. @deanishe Thanks a ton for taking a crack at it. I really appreciate it. As you would expect, you script works perfectly! And, @deanishe & @vitor your comments were also really helpful, too. I'm going to try and wrap my head around them, and get back to you. At the end of the day, it's obvious that I just need to start getting better with other languages 🤦‍♂️. Thanks again!
  3. @deanishe Thanks for getting back to me. While I might not have done it correctly, before posting this, I tried adding "Unicode" to the text references in the script above. However, it didn't fix the problem. I might be totally wrong about it encoding an issue? Oddly enough, the emojis and everything seem to show up just fine in Script Editor. Thanks!
  4. I’m struggling to get a script filter to work which outputs a variable containing a mixture of text and emojis. In the output, Alfred just spits out empty characters for the emojis (⍰ question mark in a box). There’s obviously an encoding issue I’m overlooking, and I haven’t been able to quite put my thumb on it. To explain, I’ve created a script filter with AppleScript that’s supposed to let the user select a playlist from their Apple Music library (to play it, move it, etc). I recently moved over from Spotify to Apple Music, and I have a ton of playlists (put that's a separate problem - ha)! And, as you might guess, some of my playlists include emojis. When I run the script filter, Alfred’s output just shows empty characters where the emoji’s used to be. Consider the following example: Playlist: Radiohead ⭐ Faves Script Filter/Alfred Output: Radiohead ⍰ Faves Debug: Radiohead \u2b50 Faves So, while most of this is over my head, from what I understand, my JSON output is being spit out as formatted for C/C++/Java Src (when it should be in the usual utf8 unicode format). Any suggestions for fixing it? I've never tinkered around with JSON.scpt file that does all of the heavy lifting, so hopefully it's just a minor issue with my code. Admittedly, I’ve always been confused about how JSON and AppleScript work together. Although I’ve been able to create script filters in the past thanks to everyone’s help, I’ve never made one that dealt with text that containing emojis. Thanks for any help you can lend! For testing purposes, I’ve uploaded a test workflow here: https://share.getcloudapp.com/xQuDN0dl. And, here's screenshot of its script filter:
  5. @brunoc I figured out how to implement the local smart group search, in a relatively hackneyed manner by making a few minor changes to the workflow's "dtp-list-groups.applescript" file. For some reason, you have to use the string version of "smart group." I have no idea why, but apparently it's a known problem? In any case, here's the updated portion for others that might also want to be able to select local smart groups: on reiterateOnGroup(theRec, thisDB) set my numCurrentLevel to (my numCurrentLevel) + 1 tell application id "DNtp" repeat with r in (every child of theRec) set rType to ((type of r) as string) if ((type of r is group) or (rType is "smart group")) and (name of r is not in my lstIgnoredGroups) then my addToGroups(name of r, uuid of r, thisDB) if ((my numCurrentLevel < my numLevelMax) and (rType is not "smart group")) then my reiterateOnGroup(r, thisDB & " ▸ " & name of r) end if else if (my boolSearchTags is true) and (type of r is group) and (name of r is "Tags") and (my numCurrentLevel is 1) then set tmpSaveLevelMax to my numLevelMax set my numLevelMax to 2 my reiterateOnGroup(r, thisDB & " ▸ " & name of r) set my numLevelMax to tmpSaveLevelMax end if end repeat end tell set my numCurrentLevel to (my numCurrentLevel) - 1 end reiterateOnGroup
  6. @brunoc Previously, I asked about the possibility of adding Global Smart Groups to your workflow, which I'm sure is quite the Herculean task given how different they are from the standard groups the workflow currently searches for. Would it be possible - and perhaps much easier - to, instead, add an option for the workflow to search for local smart groups (similar to how you've added an option for searching tags)? Personally, I've started using these a lot lately. And, since they don't have the same sidebar section as global smart groups, your workflow would be great for quickly accessing them. Thanks for your consideration! I use this workflow religiously these days!!
  7. This is a relatively minor feature request, but I'd love it if Alfred's Bookmarks search displayed each bookmark's full folder hierarchy. At the moment, it only shows the enclosing/parent folder's name in brackets. While my folder hierarchy for bookmarks is relatively simple compared to other files, there are some areas where I'd find it incredibly helpful to get more information about the location of each bookmark (particularly with research-related bookmarks). To explain what I'm looking for, consider the following example for a bookmark to this forum, which is located in a folder called Alfred. Within my bookmarks, the Alfred folder is located in another folder called Tech. As a result, I'd love for the subtext above to read: [Tech/Alfred] https://www.alfredforum.com/forum And, if the concern is that there will be too much text to read if the full folder hierarchy is included in the subtext, then it might be nice to include one or more of the following options (in Preferences→Features→Web Bookmarks): Parent Folder + URL (current): Allow users to stick with the default (one folder with URL) (Example: [Alfred] https://www.alfredforum.com/forum) Folder Hierarchy - URL: Include the full folder hierarchy without the URL (Example: Alfred/Tech) Folder Hierarchy + URL: Show everything, even though most of the URL might get cut off (Example: [Alfred/Tech] https://www.alfredforum.com/forum) As always, thanks for your consideration!
  8. No problem - many thanks for taking at a stab at it though!
  9. @vitor I would definitely echo @politicus statement about how awesome this workflow is! It's definitely near the top of my most used workflows. Somewhat related to @politicus question about blacklisting items, is it possible to exclude temp/invisible items? I might be wrong, but the issue seems to be limited to Microsoft Word files. When I run your workflow, it always shows a handful of Word files that start with "~$". I notice them whether I run the workflow on my Downloads or Desktop folders, etc. Thanks again for sharing the workflow!
  10. @deanishe Thanks for getting back to me! Not from what I can tell (at least, not in the same way that every other app-specific shortcut on my computer works with BTT). That's why I was asking about how to return the bundle ID of the focused app through a script. There's has to be a general way to do this outside of Alfred, right? How does Alfred do this? It's not really Gremlin water, right? I thought about going this route previously, but didn't like the idea of adding a bunch of new (intermediary) hotkeys to Alfred. They're prone to breaking (and I'm prone to forgetting about them - Ha).
  11. @Andrew OK - I think I understand what you mean here. Thanks! I'm sure I'm using the wrong terminology here, so please bear with me. But in layman's terms, I was wondering how I could tell other apps, like BTT - which I often use to kick off Alfred workflows - whether Alfred is the focused app (i.e., since the frontmost app-related checks, that I'm familiar with, won't work). Is it possible in a script (in any language) to tell whether Alfred is the focused app (i.e., that his search bar is open)? Put differently, if I launch a shortcut with BTT (or anything outside of Alfred) and I want it do something different when Alfred's search bar is open, how can it identify whether Alfred is the focused app? How would I code something like that in bash/applescript/python/whatever (re: return bundle ID of focused app)? Perhaps I'm in the minority on this one, but if you're using other things to kick off Alfred workflows - like external triggers tied to BTT, snippets, etc. - I still think having a general "focusedapp" variable would be useful - separate and apart from the hotkey object - in the same way Alfred allows people to use {clipboard}, etc. Thanks again for all of your help! You're the best!!
  12. @Andrew Thanks for getting back to me, and for your recommended approach above. I've been using it today, and it's working great. I was hesitant to copy things to the clipboard in this fashion, but everything seems to be working fine. To be honest, I had largely stopped using app-specific hotkeys with Alfred (for the depletion reasons we discussed previously), and I did not realize that the focused app variable worked with Alfred (i.e., so that it returned Alfred as the focused app). While I'm obviously not much of a coder, I assumed that it wasn't possible based on our previous discussion about Alfred never being the frontmost app. Out of curiosity, is there a way to use the "focusedapp" variable in Alfred without relying on hotkey (directly through Alfred or through a script that could be added to a workflow, etc.)? In other words, is it possible for other scripts/workflows to know if Alfred is the focused app/window/etc? That would be really helpful for some other workflows that I kick off with external triggers, and for some other apps that I use BTT with, which have shortcut conflicts with Alfred (or that require me to use modifiers that I can never remember). Regarding future UX changes, I never claimed that any of my proposals were a "simple"! 😉 In fact, I have no idea how difficult any of this stuff is (just that it takes me forever). In fact, I assumed that Alfred works something like Gremlins, and that you just added water for new features? Ha In any case, I think your timed suggestion above is perfectly reasonable, and would work great! However, I also wouldn't be terribly concerned about the "just because" use cases either. If I wasn't clear in my previous post, I should have indicated that the cursor shift would only occur at the outset when the old query is actually present and after the user hits the down arrow (i.e., not a new one or a modified one - just an old query). Of course, I have no idea whether that's technically feasible... Just add water, right?
  13. @Andrew Thanks a ton for responding to my message! I really appreciate you walking through everything. That’s very kind of you. As far as behavioral changes go, perhaps my use patterns are just a little different from the norm? While I’m not so concerned about consistency with Spotlight - after all, if I liked it, I wouldn’t be such a huge fan of Alfred 😜 - I can certainly appreciate the speed for others who might want to quickly enter a new search (i.e., because the query’s text is still highlighted). The reason I suggested shifting the cursor to the right of the query (after the user hits the down arrow, and cycles through their old results), is that, at that point, I rarely ever decide to enter a totally “new” query. Once I’ve decided that I want to act on another document from my previous query - and I’ve pressed the down arrow to navigate to the document - I rarely ever need to immediately enter a new query. In most cases, I just want to act on the file. And, if the file is not in my previous query - because I’ve lost my marbles, and can’t seem to find it - then I’m more likely to modify the query than to create an entirely "new" one (i.e., add or replace a term; not come up with an entirely new term or set of terms). As a result, for me, shifting the cursor to the right after hitting the down arrow makes more sense. It not only solves the hotkey problem, but it’s also more responsive to my use patterns (now I don’t have to press the right arrow key, the query is ready for modification, not clearance). However, if your usage stats say that people are more likely to start anew - even after cycling through a few documents in their history with the down arrow - then sticking with the current behavior probably makes more sense. Regarding your suggestion about mimicking the dispatch right arrow, I’ve never been a big fan of this approach because of its specificity to Alfred. I use this shortcut in several different apps to open files, like Finder, HoudahSpot, Alfred, etc. (and I don’t want to eat up more global shortcuts than necessary - or, more importantly, than I’ll remember). I have no idea about their technical feasibility, but would any of these options work (re: feature requests)? Add a new 3rd option to Alfred’s Advanced “History” settings, that enables the desired behavior (re: query text highlighted until the user presses the down arrow, which causes the cursor to shift to the right of said text) (or make it the default behavior, if there’s evidence that others are also more inclined to modify the search than clear it). To be clear, in this scenario, I still think it's imperative to highlight/select the query until the user presses the down arrow. Add a new special setting/action/option to Alfred’s hotkeys, that users can enable or select, which (1) still works in other apps, (2) but in Alfred, knows to only ever copy the selected result/file (i.e., never the query’s text). Add something to Alfred that allows external scripts to know when Alfred's search window is open/frontmost. We’ve talked about this before, so I won’t belabor it here. Of course, this would make it easier to operate as a global shortcut because users could just make the script operate differently for Alfred than it does for other apps (e.g., click the right arrow before copying the file path). Unlock the default action modifiers found in Alfred’s Advanced settings, such that users can include their own workflows with external Trigger IDs (i.e., beyond merely as a default fallback option). Ideally, they could use a dropdown, just like how “Workflow Triggers…” button works on a “Call External Output” object. While it's not ideal, I use this shortcut so much that I could live with losing one of the general action modifiers. I'm sure some of these suggestions are a little ridiculous, so please feel free to laugh at me. I can take a joke! Thanks again for all of your help with everything!
  14. @vitor Thanks for getting back to me! I initially considered doing what you mention above, but was hoping there was an easier way of dealing with the issue. As I mentioned above, it seems like more of a UX issue than anything. I just have to remember to hit the arrow, if I'm looking at the results from a previous query. To illustrate the description from my previous post, I've put together a short video. It's scaled down to meet the size restrictions here, so my apologies for its quality. I've attached the hotkey to a Large Type output, so it's easy to see what I mean about how the hotkey operates (however, this is just for illustration purposes - as well as the doctored username). In theory, I'd like the hotkey to send the file each time. But as you can see in the video, unless I manually unselect the previous query, it will send its text. In the video, I: Do a quick search for the term "copyright". Then trigger the hotkey - which sends the file Open Alfred, which is still displaying my previous query's results, and try to use the hotkey on the same file - which sends the query Do the same thing as above, except this time I move the cursor to the left before triggering the hotkey - which sends the file Thanks for any help you can lend!
  • Create New...