Jump to content

macrospect

Member
  • Posts

    35
  • Joined

  • Last visited

Recent Profile Visitors

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

macrospect's Achievements

Member

Member (4/5)

2

Reputation

  1. Wonderful, thanks a lot, @vitor! I also switched "is equal to" to "matches regex" and then everything worked. In case anyone finds it helpful, the final Conditional Utility looks like: if {var:app} matches regex obsidian then... if {var:app} matches regex com.ulyssesapp.mac then... else... And I think actually my workflow was kicking out the wrong bundle ids after all. I used this great workflow by Alan He instead to find the right ones. I should note that this snippet trigger ends up having a slight (split-second but noticeable) lag, in case it's relevant to anyone else.
  2. Thanks! I'm pretty sure I understand the basics in the starting guide. I was confused, though, about what happens with the "Focused app variable" in the Snippet Trigger (the description of the variable as "with" the bundle id made me think I had to specify the bundle id upfront, and that wasn't working). But now I realize that I need, within the Snippet Trigger configuration, to just name the variable something and then (I think) match the variable to the specific bundle id within the Conditional Utility. So I have set up the workflow as follows: 1. A Snippet Trigger with "focused app variable" checked and named "app." 2. A three-way Conditional Utility as shown in the attached screenshot. 3. Three Copy to Clipboards, two that paste specific content into the frontmost app and a final one that pastes the snippet trigger itself (I don't want the snippet to be transformed in other apps). However, this doesn't seem to work. In Obsidian and Ulysses, typing the trigger just gives me the trigger itself (that is, the Conditional Utility is somehow bumping me into the "else" track (I've tested to be sure)). I'm pretty sure these are the bundle ids for these apps (I've used a workflow to determine them), though. Is it apparent what I'm doing wrong?
  3. I finally found an updated workflow that does what the original workflow here used to (and perfectly!). See the Dropbox link at this thread. Created by @lehcar3. If your preferences are in Dropbox, as mine are, you will need to alter a single line in the zFolder script filter within the workflow, to the following: const targetDir = '~/Dropbox/Alfred.alfredpreferences/snippets'; For my own preferences: I also deleted the final step that shows the snippet json file in Finder, and altered the Alfred restart script at the end by deleting the final two commands (to open Alfred and the search window--just reactivating Alfred is enough for my purposes). And that means I actually don't need the Snippet Transformer workflow! Thank you, though, @vitor.
  4. I came across instructions for creating a workflow that would allow me to create snippets that only work in specified apps (referenced in this thread and explained further in this blog post). It involves using the Snippet function in a workflow, activating the "used focused app variable" option, and naming that variable "app." The blog poster used a script to specify the apps for the "app" variable (the apps in which the snippet applies). I've pasted that script below. However, I'm having a hard time getting it to work. In particular, I cannot seem to identify the right app (or really any app--the current version doesn't work for me, either). Does anyone have any suggestions? (Fwiw, I am trying to identify the Obsidian and Ulysses applications). I am using Mac Sonoma 14.3 and Ventura 13.6.3, as well as Alfred 5.5. ObjC.import('stdlib') var map = { 'com.google.Chrome': 'Hello Chrome', 'com.microsoft.VSCode': 'Hello Code', } function run(argv) { var app = $.getenv('app') return map[app] }
  5. Thank you, and sorry for providing insufficient info! I was able to figure out part of the problem (it seemed that the workflow had created a csv file on my Desktop that was not uploading to Alfred, and it was blocking the workflow from running on subsequent occasions, because it recognized that a .alfredsnippets file already existed with the relevant name). But now I have two further questions, and I'll provide more background this time. Background: I downloaded the workflow via the link you provided above. I am running Alfred 5.5, MacOS Sonoma 14.3, workflow 2023.2. I have the workflow set to read csvs with the following order: name, keyword, snippet and to open the csv upon completion. When I run the workflow now, I get a popup asking to import the .alfredsnippets file that has been created, I click yes, and then the snippet in the file is in fact added to Alfred. However, the snippet is not immediately active: I must go in to the snippets section of Alfred and tick the activate box. My remaining questions: (1) Is it possible to skip the popup window step and automatically import to Alfred? (2) Is there any way to automatically make the snippets from the spreadsheet active, so I don't have to go back to Alfred settings and tick to activate? Why I want to know this: I would like to incorporate this workflow into another one that does all of this a bit faster, because I am trying to just add a single snippet very quickly. So I am hoping to automate insertion of my snippet into the csv file and then immediately run this workflow on the updated csv file. Removing these added steps would be super helpful.
  6. @vitor, I ultimately decided to use your Snippet Transformer workflow, and can't seem to get it to work. I made the snippets csv file (depicted below with a single snippet, using the name, keyword, snippet format), and can locate it using the CSV to Alfred Snippet Collection option in the Alfred Window. But once I select the file, nothing happens. I get no notification, and the snippets don't show up. The Alfred window just disappears. Any thoughts on what I might be doing wrong?
  7. Ah. I realized that I have an Alfred Focus workflow that I edited a few weeks ago that quits apps I'm not using in current projects. I tried to exempt background-running apps, but I just checked and somehow I forgot Alfred when I edited it this time. I assume this is the solution, but I will check back if the problem recurs. So sorry to take up your time! But I am very grateful for your pointing me toward the solution....
  8. So it just happened again. Again, Alfred's hat was missing from the menu bar. I checked the Console, but no crash reports for today (and none in the past indicating Alfred). I also checked the Activity Monitor, and Alfred did not appear in the list of running apps (just to be sure, I checked for the "process name" under CPU/Memory/Disk and for "app name" under Energy, but Alfred was nowhere. He really does appear to have disappeared.... I do believe, though, that this time it may have happened again right after my computer had been asleep (though I can't be 100% sure). If there's anything else that I should check, please let me know. This does seem like a slow process, though, because it is now happening less frequently (about every other day).
  9. So the problem completely stopped for three days, and now it just came back. This time, I had the icon in the menu bar set, and it turned out that it disappeared when Alfred went missing (so option #1 that @Vero had mentioned). Any suggestions for what I might do? I should also add that my earlier observation that the issue only happens when the computer goes into sleep mode may, this time, have been disproven. I'm fairly (though not 100%) certain that I had used Alfred in between the last sleep and the disappearance of Alfred.
  10. Yes, perfect fix! @Pearcen's workflow does exactly what the original poster wanted (it switches dashes/hyphens to spaces in selected text using a universal action, and I just reversed it to switch spaces to hyphens for my own purposes). In case the link ever breaks, here's how to reconstruct it as a manual workflow: Trigger: Universal action and/or hotkey (with argument "Selection in MacOS") Utility: Replace regex - with ␣ [I reversed this for the conversion of space to hyphen instead] Output: Copy to Clipboard (with paste to frontmost app checked) [I also checked make transient on clipboard] Thank you so much, Pearcen and @Stephen_C! You saved me a ton of time.
  11. I'm looking for a similar workflow (replacing spaces with hyphens)! But the links to this one have expired. Would it be possible for a new link to it to be posted? Thank you.
  12. Thank you. I had hidden the menu bar icon, so I'm not sure. I have now added it, but this problem hasn't happened at all for the past 24 hours (not sure why). I can report next time it happens, whether the menu bar icon is present. And then yes, assuming it happens again and it's #1, I'll try to change the sync location to see if that makes a difference.
  13. Makes sense. I'm using Alfred 5.1.4, and, yes, I have made my preferences available offline (I do not optimize Mac storage). On this Mac, I'm on Sonoma 14.3. A new observation: I think this happens whenever my computer goes to sleep. It does not seem to happen in between sleeps.
  14. Thank you for the reply! I am on Alfred 5 on both work and home computers, the latest version. At work, I'm on MacOS Sonoma, latest version. At home, I'm on Ventura but I'm not sure exactly which version (can check later if relevant). I sync Alfred preferences using iCloud. I unfortunately can't think of anything that changed immediately prior to the problem starting. I did upgrade to Sonoma at work about a month or a little more ago, but I am fairly certain the Alfred trouble started at least two weeks later. I did start using Hazel about a month ago, and have introduced some new rules over the past couple of weeks, but none of these apply to the Alfred preferences folder. I also started using Ulysses for writing maybe around the same time (possibly a bit before), but I can't think of how that would be related. I have rebooted since this happened the first time, but I will try again and if it helps, I'll update here.
  15. Over the past two weeks, Alfred often is just "missing": when I hit my hotkey to open Alfred, or use any other hotkey that triggers an Alfred workflow, nothing happens. I have to go to my Applications folder and click on it before all of my workflows work. This has never happened before; Alfred is always very reliable. Any ideas about what could be causing this, and how to fix it? (Additional details: This is happening on two different macs, with synced Alfred preferences, each of which is running a different version of MacOS. It often happens when I first wake up the computers from sleep/screensaver in the morning, but I believe it's occasionally happened at other times during the day, too. Alfred is set to open at login, and anyway I don't fully turn my computers off often.)
×
×
  • Create New...