Jump to content

lilyball

Member
  • Content Count

    40
  • Joined

  • Last visited

Everything posted by lilyball

  1. 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.
  2. 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!
  3. 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.
  4. @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.
  5. 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?
  6. 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?
  7. 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.
  8. 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 does Alfred save the history. And I don't have Maps configured in the Ignore Apps section.
  9. 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 that composed character. And if I try to pass it decomposed characters, it should be given decomposed characters. I have a suggestion for an alternative workaround here. What if you added a third option for input, to pass it in via stdin (instead of argv or {query})? Then you could simply not normalize the stdin approach, because it's far less likely to be used for filenames than it is to be used for arbitrary text. And NSTask won't normalize for you here. As an aside, I just tested and it appears that current script actions are executed without closing off stdin. I made a script that ran `cat` as part of its processing, and the script never completed. I would have expected Alfred to run scripts with stdin either closed directly or connected to /dev/null, so that way anything that tries to read from stdin won't hang forever.
  10. 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.
  11. 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.
  12. 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 filesystem APIs and letting them do the comparison). But in general, OS X doesn't care if you're using composed or decomposed strings. If you write a script to a file, and then invoke that script via NSTask, the NSTask APIs never actually see the input string and therefore won't have a chance to decompose it. Why? There's no need for normalization in most cases. There's certainly no benefit to normalizing the arguments passed to Alfred workflows. And so whether it's composed or decomposed doesn't matter. That's not an argument for decomposing strings. That's jut an argument for using unicode canonical equivalence when comparing strings.
  13. 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, and therefore the whole script is handled as an argument? It should return whatever input I give it. It shouldn't be converting my input into either NFD or NFC form, just using it as-is. I'll grant you in most cases it won't really matter, but in some cases, like my workflow here, the difference is very important.
  14. 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, install the workflow and type "char 각". It should return U+AC01 HANGUL SYLLABLE GAG but instead it returns U+1100 HANGUL CHOSEONG KIYEOK, U+1161 HANGUL JUNGSEONG A, U+11A8 HANGUL JONGSEONG KIYEOK.
  15. Good point. I sure wish AppleScript simply had a `paste` command :/
  16. 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. I do wish Alfred had a built-in way to "paste to frontmost application" without modifying the clipboard, by using assistive access in order to click the Paste menu item, seeing as that does wait for the application to handle the paste before returning. But at least now I know how to work around this with Apple Script.
  17. 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?
  18. I just hit this issue. I wanted to paste something and then restore the previous clipboard. But Alfred doesn't seem to support that (at least, not without introducing a delay, which I didn't try). If I store the clipboard in a variable, then use Copy To Clipboard w/paste to paste something in the app, and then use a separate Copy To Clipboard action to put the variable back on the clipboard, Alfred runs the second Copy To Clipboard before it pastes in the app. I'd really prefer not to have to fall back to AppleScript just to do this, since it's not all that uncommon of a thing to want.
  19. Also, after reading that, it seems the support you have right now is for copying data from the XML output. That's still not usable for my purposes. I want to be able to run a script action and copy the results of that instead. The reason being I don't want to run the action on multiple different results when the user can't copy them all, and may not even copy any. I just want to run my action once the user has told me that they need the results.
  20. Oh wow when did that documentation show up? I've always used http://www.alfredforum.com/topic/5-generating-feedback-in-workflows/as my source for this stuff, and it doesn't mention that. You should update that forum post to link to the documentation.
  21. Related to this would also be supporting Cmd-L to do Large Type with the output of a workflow command. For example, if I type "=1+2" and hit Cmd-L, it shows "3", but if I run a workflow command instead, Cmd-L just shows exactly what I typed (even for script filter workflows).
  22. When creating a workflow, you can double-click on the Input->Action connection to set up a modifier for that connection and custom subtext. But there's no way right now to run the same script for all modifiers and merely control the action taken, short of duplicating the script (and yes, you can put a common script in the workflow and call it from each action, but that can be a bit annoying). It would be nice if you could instead set the Input->Action connection to a new value "any" and then configure the modifier and subtext on the Action->Output connection. For example, I might have a script that spits out a filename, have the default action do something with that file, and have option-return do something different with that same file.
  23. Various actions in Alfred support pressing Cmd-C to copy them. I'd love to be able to support this in my workflow. Specifically, I'm creating a workflow right now that runs a script with a keyword trigger with the action being Copy to Clipboard & Automatically paste. I want to be able to press Cmd-C to just copy without pasting. Three thoughts on how to do this: 1. If an action would Copy to Clipboard, support Cmd-C to copy as well without pasting (and without running any other actions). This would only work for actions that already copy though. 2. More generally, Alfred could support just copying the output of any script to clipboard with Cmd-C. The downside here is you'd get the exact output of the script, which may not be correct (e.g. the Copy to Clipboard action may add other text around the {query}). 3. A variant on #1, perhaps the Copy to Clipboard action could gain a new boolean option "Copy only with Cmd-C". This way you could add Cmd-C support to existing workflows but have it only copy on Cmd-C and not on normal action triggering.
  24. When using the iTunes control keywords "next" and "previous", or the Workflow iTunes Command action for Next track / Previous track, it doesn't work at all when listening to an Apple Music album that's not in my library. Triggering it logs an AppleScript error to the Console: I'm rather curious why it's even trying to get the index of the current track, since iTunes has special AppleScript commands for next / previous track. It also has a separate "back track" command which is preferable to "previous track" because "back track" will rewind to the current track if you're not near the beginning, and will only go to the previous track if you're already at the beginning of the current track (i.e. it behaves like the rewind button in iTunes's UI).
  25. I'm working on a workflow, and I want a script filter result to be invalid, but to be valid if I hold Option. Is there any way to accomplish this? The context is that holding Option lets you delete a result, but the regular action isn't valid unless you type a second argument.
×
×
  • Create New...