Jump to content

lilyball

Member
  • Content Count

    48
  • Joined

  • Last visited

Everything posted by lilyball

  1. What I'm getting it from is an Automator workflow set up as a Service. Both file input to the service, as well as the "Get Selected Finder Items" Automator action, seem to be producing these same objects.
  2. I knew it was possible, but as someone who touches Apple Script maybe once every few years, it's very non-obvious. It would be nice if Alfred could simply handle whatever file type that Apple Script uses by default.
  3. If I write an Automator Apple Script action like on run {input, parameters} tell application id "com.runningwithcrayons.Alfred" to action input return input end run where the input is files (either Service inputs, or the results of "Get Specified Finder Items"), Alfred opens the browse panel but with the garbage input that looks like file:/slash/separate/path%20with%20percent%20encoding.txt I can instead pass `POSIX PATH of input` and that works, but only for one file. I'm not sure how to convert a list of files into a list of paths in AppleScript. Thankfully I can do this with
  4. I'd love it if Alfred would vendor an Automator action for running external triggers. The use case here is I want to use Automator to write a Service that sends its input to Alfred. I can use Apple Script but it would be more convenient if there was an Automator action for this.
  5. Also possibly worth mentioning, my workflow was actually triggering "Browse in Alfred". If I switch over to "Action in Alfred" (which matches what the built-in hotkey actually does) then this problem goes away, because the action panel doesn't seem to respond to tapping modifiers the way the browse panel does. Still, I like being able to browse.
  6. Now that I’m just limiting it to the Finder it’s more reasonable to do that. In general I avoid using ⌘ in global hotkeys because I don’t want to interfere with apps. Though I ended up limiting it to the Finder specifically because ⌃⇧\ was interfering with Xcode 😅 (though to be fair ⌘⌥\ would have interfered with Xcode too). Though now that I think about it, why is this a hotkey at all, instead of a Service? A Service would mean not having to muck about with Copy to figure out my selection. And IIRC service hotkeys are overridden by app hotkeys, so using ⌘⌥\ as a default hotkey for
  7. I forgot that setting existed. It does work around my issue, but it also slows down the activation of the shortcut, which is a shame.
  8. I have a workflow that uses a Hotkey to trigger "Browse in Alfred". I've done this instead of using the built-in support so I can restrict the hotkey to only occur in the Finder, as that's the only app I ever use this feature with and the hotkey I use conflicts with Xcode. Anyway, I just discovered a problem today, which is that Alfred interprets the flag changed events for the modifiers used by the hotkey incorrectly. As near as I can tell, it's trying to detect a quick press-and-release of the shift or control modifiers to trigger the associated behavior (quicklook or showing the
  9. The workflow Open URL action only has one custom option, which is whether to use the default application or pick a specific one. It would be great if it supported the other options available when opening URLs, most notably the ability to open a URL without bringing the application forward.
  10. Oh geeze. I completely didn't know that cog was a button. Also, I don't have "Automatically expand snippets" checked, so it seems very surprising to me to bury preferences that have nothing to do with auto-expansion in that spot, though I guess it's because it's right next to the (I assume) pre-existing "After Auto Expansion" option. Anyway, thanks!
  11. The v3.4.1 release notes say I can't find this option anywhere. Where is it? I also don't know what "(option shared with snip keyword)" means; I tried turning off the "snip" keyword option and that didn't affect the clipboard contents.
  12. @Andrew Excellent. I'll check that out now. Incidentally, the first line of the change log for the pre-release has a typo ("exapnsion"). As for reporting it, you could do that, but I'm honestly not sure how they're supposed to know that clipboard changes are complete. I can erase the clipboard now, then write one piece of data to it, then a bit later on add more data to the clipboard, and there's no way for me to say that I'm "done" mucking with it.
  13. What if you call `clearContents()`, then add an artificial delay, then `writeObjects()`? As long as ownership didn't change in the meantime, could this cause Alfred to see the change count increase with nothing on the pasteboard, and then have the pasteboard populate shortly afterwards?
  14. I just tested copying from Maps and then printing out NSPasteboard.general().types and I get the expected types. So maybe it's just something weird like there being a very short delay in between you getting notified of a change (how do you get notified anyway?) and Maps actually declaring the types properly?
  15. If I press ⌘⌥C in Maps, which is just Copy Link, then Alfred clipboard history works correctly. But this produces the same pasteboard as regular Copy, just without the image. The presence of a large image shouldn't cause Alfred to skip saving the plain text.
  16. If I search for a place in Maps and hit ⌘C, it copies both an image of the map, as well as plain text that contains a URL like https://maps.apple.com/?address=826 Folsom St, San Francisco, CA 94107, United States&auid=7989913039222126743&ll=37.781586,-122.402010&lsp=9902&q=Zero Zero&t=m. I have Alfred configured to save plain text, so I would expect Alfred's Clipboard History to retain the URL there, but it doesn't. Alfred doesn't keep any history of URLs copied from Maps.app. I've tested this with "Keep Images" enabled and with it disabled, and in neither case
  17. Your "consistent behavior" is my "broken behavior". You're telling me you're doing extra work to ensure there's no way for me to get un-normalized text, and that's extremely annoying. I feel like you don't actually understand my problem. I don't want normalized text. If I needed a particular normalization, I'd do it. But I want to pass the input exactly as provided to my script, because my script behaves differently when providing composed vs decomposed characters, and that behavior difference is very important. If I try to pass it a composed character, it should be given
  18. Also, I have no idea what you're suggesting wth Write Text File. My workflow is a Script Filter workflow. There doesn't appear to be any way I can possibly get the input argument passed to my workflow without normalization. Alfred's behavior here is completely ******* with my workflow for no good reason and I don't see a workaround.
  19. What's the point of deliberately normalizing, though? In nearly all cases it won't matter, it just screws with cases like my workflow where I explicitly care about the difference.
  20. In most cases OS X does not normalize your text either way. HFS+ prefers NFD. NSTask here is the only other case I can think of where it's forcing your text to NFD, and even that was a complete surprise to me. The only justification I can think of for why is if it's using -[NSString fileSystemRepresentation] to create the C strings that it passes to the underlying POSIX APIs, and the only real reason to do that is to handle the weird edge cases with programs that accept input and then do byte-wise comparisons against the filesystem (as opposed to passing the string to the
  21. What does HFS+ filenames have to do with passing arguments to the command-line? It does appear, though, that NSTask does convert arguments to NFD, though I have no idea why that would be. I'm also not sure why that's particularly relevant here; I'm passing the input using {query}, not as arguments, so presumably Alfred is dynamically constructing a script that embeds my input and then running that script, which means NSTask doesn't ever see the input directly (and therefore cannot convert it to NFD). Edit: Or is Alfred evaluating the script by passing it to /bin/bash -c
  22. It looks like Alfred is automatically converting workflow arguments into decomposed form. I swear it didn't used to do this, but I can't be certain. I've created a workflow you can use to test this. The workflow is invoked with the "char" keyword and shows the unicode codepoints for the workflow argument. If I paste in a precomposed character, the workflow shows me the info for the decomposed form. I've verified by running the workflow binary in the Terminal that the workflow does properly handle precomposed characters, so it must be Alfred decomposing it. To test, inst
  23. Good point. I sure wish AppleScript simply had a `paste` command :/
  24. I just tested, if I use Apple script to explicitly click the "Paste" menu item, then the application pastes before the Apple Script continues, which allows me to immediately set the clipboard again without delay. But of course this does require assistive access. I should probably just grant that to Alfred 3 and use this technique. But you are right, if I keystroke ⌘V with Apple Script, it does not wait, and therefore I would have to introduce a delay in order to set the clipboard. Ah, that would make sense. Very cool, thanks.
  25. In fact, it's not actually obvious to me how to reproduce Alfred's behavior for pasting the current clipboard. If I use `tell application "System Events" to keystroke "v" using command down` then it fails if I have any keys held down when I trigger the workflow (e.g. pressing shift-return). If I instead try to click the menu item "Paste" in the menu "Edit", I get told that Alfred 3 doesn't have assistive access (I don't use auto-expanding snippets so I guess I never hit this problem). So what is Alfred doing in order to paste in the current app?
×
×
  • Create New...