Jump to content

deanishe

Member
  • Posts

    8,759
  • Joined

  • Last visited

  • Days Won

    522

Everything posted by deanishe

  1. You can add alfred:ignore to an item’s Spotlight comments to tell Alfred to ignore it. More generally, if you stop telling Alfred to associate Spotlight with your query by actioning it, it won't be the top result. Alfred learns from your behaviour, so it’s very important to consistently use the same queries for the same applications (or other items). If you consistently select Spotify for the query sp, Alfred will always make Spotify the top result for sp. But if you also select other things for the same query – deliberately or otherwise – the results will jump around.
  2. This is the wrong way to go about it. Simulating user input (mouse clicks, keypresses) is a last resort because it's so unreliable. You should always use an API where possible, and Music.app has one. The AppleScript command to play a playlist is tell application "Music" to play playlist "name of playlist"
  3. It doesn't update workflows, it updates a library they use. Its only purpose is to fix an incompatibility of older workflows with High Sierra and later. Many workflows include their own updaters and will update themselves or tell you to update them when you use them. There's no way to check all workflows at once, but a lot of them should automatically update when you actually use them.
  4. Why does it receive that? You can't manipulate the formatting in the JSON Config itself. You need to make sure the input is valid to begin with.
  5. The default keyword behaves exactly the same. What do you mean? We don’t know what you have g assigned to.
  6. This seems to work: But regular expressions aren't really the right tool for this kind of job.
  7. It's definitely a great solution for anyone that doesn't actually use Chrome. IIRC, Chrome doesn't react well to another application changing its Bookmarks files. Alfred doesn't care, of course. If you do use Chrome, I'd recommend creating a separate profile only for symlinking your Edge bookmarks to.
  8. If you're going to put characters in the snippets that aren't allowed by JSON, you'll need to use a real JSON library to generate the JSON in order to escape the illegal characters properly. That is to say, you need to write a script. Why are you generating the UUID yourself instead of using the "Add UUID to filename" option in Write Text File?
  9. Nah, it blocks it (or at least does on Catalina). Immediate failure. The DNS explanation sounds more likely. Adding the hostnames to /etc/hosts is a common way of blocking it. That's incredibly annoying if Apple broke DNS blackholing instead of fixing the damn service. Personally, I'm so annoyed by what they've done. I bought a top-of-the-line iMac last year, and the damn thing launches apps more slowly than the 2008 Mac Pro it replaced thanks to this bollocks security theatre.
  10. You have a version of macOS that no longer includes PHP. You need to install it with Homebrew. https://www.alfredapp.com/blog/releases/alfred-4-6-ready-for-macos-monterey/
  11. Well, that depends on what's immediately before the Reveal in Finder. If it's the above shell script, add the line: echo -n "${TARGET_FOLDER}/${1:t}" Note: That's zsh-specific. It won't work with bash.
  12. Hmmm. That shouldn't actually cause the problem. If macOS can't contact the server to check the hash, it just lets the app run. (Blocking with Little Snich was one of the first suggested solutions for this stupid system.) Then again, my info is Catalina vintage. It's possible they've made it even more stupid since then.
  13. You pass in the path of the file you want to reveal in Finder.
  14. Preference panes are files, too. Use ⌘↩ on "Printers & Scanners" in Alfred to reveal it in Finder.
  15. The filename doesn't matter. Alfred adds a UUID to prevent any name clashes, but it's not required. Variables only exist while the workflow is actually running. If you didn't explicitly save the variable to info.plist, there is nothing to clean up. Alfred watches the filesystem for changes. As long as you don’t have any symlinks in your prefs bundle, Alfred should notice new snippets immediately. Thanks. I'll have a look at it in the morning. It's time for bed now.
  16. Hi @MauMaus, welcome to the forum. You might be able to exclude Printers & Scanners if you add alfred:ignore to its Spotlight comments (via Get Info in Finder). That's the standard way to tell Alfred to ignore something, though I've not know anyone to try it with a preference pane before. It sounds like you might not be using Alfred quite right. Alfred learns from your past choices, so it's important to always use the same keywords for the same items. For example, if you always choose "ScannerPro" for the keyword "scan", Alfred will always ensure it's the top result when you enter "scan". But if you choose different results for the same keyword, you're giving Alfred mixed signals, and the results will jump around unpredictably.
  17. We can't answer questions like this about a workflow we've never seen. Please upload the workflow somewhere and post a link, so we can see what you're talking about.
  18. You can add a note to each element for precisely such purposes. Right-click on an element and choose "Edit Note" (IIRC - I'm not at a computer right now).
  19. If it's a short, static list of folders, just create a List Filter by hand. To get a dynamic list, put this script in a Script Filter with “Argument Optional”, Language = “/usr/bin/osascript (JavaScript)” and “Alfred filters results”. Obviously, you’ll need to change targetPath at the top of the script to point to your snippets directory. // Path to snippets directory const targetDir = '~/Desktop'; function getSubdirectories(folder) { let dir = $(folder).stringByStandardizingPath; fm = $.NSFileManager.defaultManager; return ObjC.unwrap(fm.contentsOfDirectoryAtPathError(dir, null)) .filter(name => !name.js.startsWith('.')) .map(name => dir.stringByAppendingPathComponent(name)) .filter(path => { let isdir = Ref(); _ = fm.fileExistsAtPathIsDirectory(path, isdir); return isdir[0]; }); } function run() { let dirs = getSubdirectories(targetDir); console.log(`${dirs.length} folder(s) in ${targetDir}`); let items = dirs.map(path => { return { title: path.lastPathComponent.js, arg: path.js, type: 'file', icon: {path: path.js, type: 'fileicon'}, }}); return JSON.stringify({items: items}, null, 2); }
  20. I don’t really understand what the problem is. You just need to do exactly the same thing as the first three steps: Connect the File Filter to an Arg & Vars to create a new variable (say dirpath), then configure the Write Text File to write to {var:dirpath}/{var:name} [{var:rand}].json If the problem is "how do I get a dropdown list?", File Filters don't work that way. They only show search results. No search query, no results. To get a list without a search query, you'd have to use a List Filter or Script Filter instead.
  21. Hi @mitchoff, welcome to the forum. It sounds like you're describing the standard behaviour of ⌘H and ⌥⌘H. In what way do they not do what you want?
  22. Then use an Arg & Vars utility. If you want a better answer than that, please upload your workflow somewhere and post a link, so we can see what you're talking about.
×
×
  • Create New...