Jump to content

deanishe

Community Hero
  • Posts

    8,328
  • Joined

  • Last visited

  • Days Won

    500

Everything posted by deanishe

  1. Why? What's the use case? What do you think the typical Alfred user is going to do with the feature? To my mind, this sounds very niche. And there are already applications that can do this.
  2. Yeah, this keeps biting me, too, and it's rather irritating. The Universal Action list just doesn't behave like Alfred is supposed to (in my mind). I'm not sure there's a lot of value in manual ordering. Re-ordering results based on your usage is kinda Alfred's thing, and it makes a manually-ordered list somewhat pointless. To my mind, the issue is rather that the algorithm Alfred currently uses to sort Actions is different to the way normal search works. We all train ourselves to consistently use the same search terms for the same items, and in return Alfred consistently ensures that the same item is always the top result for a given query. But the Actions list deviates from that behaviour, making it inherently somewhat tricky to use.
  3. Short answer: no. There's no option or API to tell Finder to open folders in a new tab. The only way to do it is to blindly fire simulated keypresses at Finder, wait a bit and tell Finder to navigate to the folder, hoping a new tab has opened in that time. It's very unlikely that Andrew would add that behaviour to Alfred because it's so hacky and unreliable.
  4. I don't know if anything has changed, but I'm certain Alfred doesn't and never has launched detached workflow processes. I believe Alfred uses NSTask to run workflows, and that doesn't even support anything fancy. If LS is now detecting Chrome as a subprocess of Alfred when it wasn't before, it seems far more likely that something has changed in Chrome or LS (or the macOS APIs it uses). I don’t have Big Sur or LS 5, but the “new” behaviour you describe is how previous versions of Little Snitch have worked for many years. If you run curl in a shell, LS asks about “iTerm via curl”. Similarly, it has always asked about “Alfred via <workflow-binary>”. That is exactly the behaviour I would expect if Chrome is really running in the subprocess, not handing off to an already-running instance.
  5. The best solution is to launch Alfred when the volume is mounted. Try the Launch Agent I posted here:
  6. It appears to be a bug with the File Buffer. If "Clear File Buffer" is turned on and there are already files in the Buffer, they are removed, but the new files are not added. (Can you confirm, @Andrew? I'm using 4.6 [1266])
  7. Upload the workflow to your Dropbox or iCloud drive and post a link. Alfred has never run workflows that way. It can't run workflows as detached processes because it needs to be able to read their output, know when they've finished and what their exit code was. I'm pretty sure the only thing that matters is whether Chrome is already running or not. If you execute the binary directly and Chrome is already running, it passes off the command to the running instance and exits immediately. If Chrome isn't already running, it starts a new instance right there, stays attached, and doesn't exit till you quit the application. These two modes seem to correspond fairly precisely with the "old" and "new" behaviours you describe.
  8. Not sure, tbh. I've never really used the File Buffer. Perhaps @Andrew can explain?
  9. Probably. Look in the Browsers tab of your 1Password preferences and see what it says you need to do for Chrome.
  10. Hi @ell1134, welcome to the forum. If you put the script in a Run Script box, Alfred will automatically pass its output to the next script. Doesn't matter, though. It's better to write the whole thing as one script. Try this: -- Maximum time (in seconds) to wait for the new window to appear. property _timeout : 2 tell application "Safari" activate set _url to URL of front document set _count to (count of windows) -- Open a new private window tell application "System Events" to keystroke "n" using {shift down, command down} -- Wait up to _timeout seconds for the new window to appear repeat (_timeout * 10) times delay 0.1 if (count of windows) > _count then -- New window will be the front window (i.e. window 1) tell window 1 to set URL of current tab to _url return end if end repeat -- If we reach here, the script timed out waiting for the new window to appear display alert ¬ ¬ "An error has occured" message ¬ "Timed out waiting for new private window" as critical ¬ buttons {"OK"} end tell
  11. Right, I think I understand what you mean. The macOS window manager doesn't work that way, so there are no APIs for what you want, I'm afraid. The only thing you can do to an individual window is minimise it or bring it to the front. You can't move it forwards unless it's to the front, and you can't move it backwards at all.
  12. If you can explain what you're trying to do in terms of the way the macOS window manager works, we can probably help.
  13. This AppleScript will open each of the groups defined at the top of the script in a separate Finder window, with each path in its own tab. -- each list in groups will be opened in tabs in the same window property groups : {¬ {"~", "~/Documents", "~/Downloads"}, ¬ {"~/Library", "~/Library/Application Support/Alfred", "~/Desktop"}} -- How long to wait (in seconds) between simulated keypresses. -- Increase this value if the script works unreliably property _delay : 0.25 use framework "Foundation" -- expand ~ in path to home directory on normalisePath(_path) set _string to stringWithString_(_path) of NSString of current application set _norm to stringByStandardizingPath of _string return (_norm as string) end normalisePath on run tell application "Finder" activate repeat with _paths in groups -- create new window to open tabs in make new Finder window --open folder "Documents" of home delay _delay -- for each path, open a new tab and navigate to the path repeat with _path in _paths set _path to my normalisePath(_path) -- log "path=" & _path & ", target=" & POSIX path of (target of front window as alias) -- simulate CMD+T to open a new tab tell application "System Events" to keystroke "t" using command down delay _delay set target of front window to (POSIX file _path as alias) delay _delay end repeat -- close initial tab tell application "System Events" keystroke tab using control down keystroke "w" using command down end tell delay _delay end repeat end tell end run
  14. That's a clever idea. You might consider sharing your scripts and Karabiner config on the forum or GitHub (as a gist, perhaps). I'm sure some people will find that really useful.
  15. Please don't post screenshots like that. We can't tell you what's going wrong from screenshots of a workflow doing nothing any more than a mechanic can look at a photo of your parked car and tell you why it won't start. Look in the workflow debugger to see what Alfred/the workflow say. Workflow Environment Variables in the workflow's configuration sheet.
  16. Please try searching the forum for an existing thread on the topic before creating a new one. There are already lots of threads all about Google Drive, why it doesn't work, how to make it work temporarily, and a workflow to search your Drive until Google finally fixes it properly. I'm locking this thread, as there are already half a dozen Google Drive threads.
  17. You can't have looked too closely: what you're after is directly under the description of the search command. tell application id "com.runningwithcrayons.Alfred" to action "/some/path/or/text/here"
  18. Glad you got it working, and thanks for the beer money 👍 What's your "Alfred mode"?
  19. @Mr Pennyworth might have some ideas: he's written a couple of applications that need to know what Alfred's doing. You might be able to use the notification API Andrew added for him, which would be absolutely ideal. The only thing I can think of is an AppleScript that launches Alfred, then waits for it to close: -- Do stuff here to enter "Alfred mode" -- Open Alfred tell application id "com.runningwithcrayons.Alfred" to search "" tell application "System Events" tell application process "Alfred" -- Wait for Alfred window to appear repeat while (count windows) = 0 delay 0.1 end repeat log "Alfred open" -- Wait for Alfred window to disappear repeat while (count windows) > 0 delay 0.1 end repeat -- Exit "Alfred mode" here log "Alfred closed" end tell end tell You could do your setup and teardown in the script or before it runs and after it exits.
  20. Interesting. Mine is /Volumes/GoogleDrive, which is also the usual path, AFAIK.
  21. I think that's unlikely: it's too much of a foot-gun for the reason described above. Users would be trying to run 20 workflows at the same time, and then they'd complain that Alfred is slow and needs fixing. If they have to change all the keywords manually to get the workflows to run at the same time, they'll (usually) accept it's their fault that their Alfred runs really slow. If Alfred has a button that makes the same thing happen, they'll blame Alfred/Andrew, even if there's a big, fat warning. That's what always happens.
  22. That’s Finder lying about the name. The actual volume is called GoogleDrive (no space). Double check by running ls /Volumes in a shell or entering /Volumes/ in Alfred.
  23. I'd like to see aliases added, tbh. People/things have a fairly fuzzy one-to-many relationship with names, and some equivalent of aliases is important in a system is supposed to adapt to the user. Duplicating Keywords/Script Filters is a poor workaround because any duplicates will get removed if the workflow is updated, while keywords (and by implication aliases) are preserved.
  24. I'm sure this behaviour is deliberate. Alfred will run the Script Filter, but only if the keyword matches exactly. If Alfred were to run every Script Filter whose keyword starts with m in this situation, it might end up trying to run a dozen or more workflows.
  25. Alfred uses word-starts-with semantics: my or file should also match this is my file.doc. To search within words, prepend an asterisk to the search term: *his will match this as well as history.
×
×
  • Create New...