Can't set Service shortcuts while in text editors?

Discussion in 'macOS' started by printz, Apr 17, 2013.

  1. printz macrumors regular

    Joined:
    Dec 23, 2012
    #1
    I'm using an Automator application menu service that spawns a new Terminal window and I've assigned a shortcut to it (control+alt+t). In most applications it works, but not in certain text editors like TextEdit or Smultron 5. I tried other control-based shortcuts, but neither those worked. Control+alt+t in particular even inserted invisible characters in the text! What gives? Can I bind some other keys while in text editors or am I out of luck?
     
  2. benwiggy, Apr 18, 2013
    Last edited: Apr 18, 2013

    benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #2
    Services usually act upon the current selection. Their availability in the Services menu depends on what the current selected objects are.

    For instance, in the Finder, there is already a service that creates a new Terminal window with the working directory of the currently selected folder. (in Lion and above.)

    What does your service do that other ways of creating a new Terminal window does not?

    Without seeing the Automator actions/script, it's hard to say more about why it isn't working.
     
  3. printz thread starter macrumors regular

    Joined:
    Dec 23, 2012
    #3
    There is? Where do I find it? Most of the time the Services submenu from Finder is empty. I had to write an AppleScript and package it into an app that's pinned to the Finder toolbar. It works great.

    Regarding my service that I can't reliably bind a key shortcut to, it's an Automator unit that works on any application, receives no input, and all it does is run this AppleScript:
    Code:
    on run {input, parameters}
    	
    	(* Your script goes here *)
    	tell application "Terminal"
    		do script " "
    		activate
    	end tell
    	return input
    end run
    
    On all applications, the service is visible from the submenu and works if clicked. On those where the keyboard shortcut works, the shortcut is also visible on the submenu. Of course maybe if i find another key combo it will eventually work, but it would be lovely to bypass this limitation, if possible.
     
  4. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #4
    System Preference > Keyboard > Keyboard Shortcuts > Services: "New Terminal at Folder".
    I think it's unchecked by default. Just tick the box and it will be active.

    If your Service is showing, but the key shortcut is missing, then perhaps the applications are using that combination and taking priority.

    You can always just right-click on the Terminal icon in the Dock to create a new Terminal window. If you're looking for a keyboard command for that sort of thing (and others), then you might want to try iKey or Keyboard Maestro.
     
  5. printz thread starter macrumors regular

    Joined:
    Dec 23, 2012
    #5
    Awesome! Didn't know OS X has it already (I thought I had to work to have it :) )

    EDIT: oh, i only see some folder-triggered services, and my Finder-pinned AppleScript works good enough anyway. I guess I can just right-click the dock icon if I'm not on fullscreen, or use Spotlight.
     

Share This Page