Jump to content

lilyball

Member
  • Posts

    48
  • Joined

  • Last visited

Reputation Activity

  1. Like
    lilyball reacted to Andrew in Workflow using hotkey to trigger "Browse in Alfred" handles flag changed events poorly [Fixed 4.1.1 b1171 pre-release]   
    I should have this fixed in the next build.
     
    Interestingly, Alfred was already attempting to defend against this scenario, but with some code which hasn't been touched for quite some time. I've updated the way it gets the current mods, and it now works as you would expect.
  2. Like
    lilyball got a reaction from gingerbeardman in Option in workflow Open URL action to open in the background   
    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.
  3. Like
    lilyball reacted to Andrew in Where's the new option to restore clipboard after using Snippet Viewer?   
    @kballard the sheet from that cog only used to contain preferences relating to auto expansion, but it's now outgrown this. It's likely this cog will be replace with something more obvious in a future release.
  4. Like
    lilyball reacted to Andrew in Clipboard History doesn't include URLs copied from Maps.app [Fixed 3.4 b837 pre-release]   
    @kballard hmm, I had (wrongly?) assumed that this would have either been wrapped in a single pasteboard "transaction", or clearContents would have adjusted the clipboard change count (i.e. clipboard changed to empty), then writeObjects would have adjusted it too (i.e. changed to contents).
     
    I've had a bit of a play with this and I can comfortably ignore clip counter changes until there are types available.
     
    Thanks for highlighting this - I'll have this fixed in the next 3.4 pre-release
     
    Cheers,
    Andrew
  5. Like
    lilyball reacted to deanishe in Paste to the front most application - standalone   
    It's nothing to do with Alfred, it's the way OS X works. When you send keypresses to an application (i.e. paste), the system doesn't wait for the application to handle them. Your call returns immediately. So what's happening is that you're restoring the keyboard before the application can act on the paste instruction. You need to put a delay between pasting and restoring the clipboard to give the paste time to complete.
     
    That's one of the reasons why it's a terrible way to automate applications.
     
     
    I'm 99.5% certain Alfred also simulates ⌘V. I'm also pretty sure Alfred doesn't have the same problem (it breaks if the user is holding other modifier keys) because it uses Carbon, not System Events, to simulate the keypress.
     
    This JavaScript function simulates ⌘V via Carbon and should also ignore whatever you've got your fingers on:
    ObjC.import('Carbon'); // Simulate CMD+V keypress via Carbon. Unaffected by other modifiers the user may // be holding down. function paste() { var source = $.CGEventSourceCreate($.kCGEventSourceStateCombinedSessionState); var pasteCommandDown = $.CGEventCreateKeyboardEvent(source, $.kVK_ANSI_V, true); $.CGEventSetFlags(pasteCommandDown, $.kCGEventFlagMaskCommand); var pasteCommandUp = $.CGEventCreateKeyboardEvent(source, $.kVK_ANSI_V, false); $.CGEventPost($.kCGAnnotatedSessionEventTap, pasteCommandDown); $.CGEventPost($.kCGAnnotatedSessionEventTap, pasteCommandUp); }  
×
×
  • Create New...