Automator

Discussion in 'macOS' started by covertsurfer, Sep 20, 2008.

  1. covertsurfer macrumors 6502a

    Joined:
    Jan 18, 2007
    #1
    I think this is the correct program to use. I often copy text from a web page, press Ctrl + T then Ctrl + V and then enter to visit the url I just copied.

    Is it possible to record that action and then assign a hotkey to the action?

    I guess it should only run once it knows there is something in the clipboard.

    Thanks
     
  2. gusious macrumors 65816

    gusious

    Joined:
    Dec 2, 2007
    Location:
    Greece
    #2
    Not sure... Never heard of anyone doing it...
     
  3. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
    #3
    Here's an applescript that copies the selected text, opens a new tab, then pastes the text and presses enter. Not sure about how you're going to do that hotkey thing.
     

    Attached Files:

  4. numlock macrumors 68000

    Joined:
    Mar 13, 2006
    #4
    dosent safari recognize most url´s and when right clicked allows you to open in it in a new tab, window etc?

    You can assign a hotkey to run scripts with spark or quicksilver for instance but im not sure how pleased you will be with how it works ie the time the whole process will take
     
  5. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #5
    Thanks for the applescript! Thats amazing! Everytime I want to run that script, what are the processes involved?

    Thanks again
     
  6. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #6
    thanks :)
     
  7. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #7
    I've tried to follow this but I think it might be out of date so I cant get this to work, Please help
     
  8. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
    #8
    The crucial point is the delay. In the version I uploaded there is none so whenever you start the app it copies etc. right away without a chance of you switching to your browser window.

    You'll have to figure out how to invoke it with your browser activated. Do you use Safari?
     
  9. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #9
    I think I have it running now but I have edited it just so it has

    Code:
    tell application "System Events"
    	keystroke "t" using {command down}
    end tell
    
    However, the window flickers or loses focus and comes back and doesn't open a new tab
     
  10. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
  11. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #11
    I think I've got it working but you're the expert so I'll wait to see what you come up with. I'm using Firefox
     
  12. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
    #12
    Tada: (Should be working now :) )
     

    Attached Files:

  13. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #13
    That did it, do you have the script for it?

    I've added this not sure if thats what you did
    Code:
    tell application "Firefox"
    	activate
    end tell
    tell application "System Events"
    	keystroke "c" using {command down}
    	keystroke "t" using {command down}
    	keystroke "v" using {command down}
    	key code 36
    end tell
    
     
  14. ergdegdeg Moderator emeritus

    ergdegdeg

    Joined:
    Oct 13, 2007
    #14
    Yea, that's what I did. Now you only have to figure out how to invoke that with a keystroke. I was thinking of creating an item in Services but somehow it doesn't work. Maybe look into Quicksilver or another launcher?
     
  15. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #15
    I've tried going to system preferences - keyboard and mouse and adding a shortcut there but it doesn't seem to work when i press the shortcut. If I got the scripts menu and run it, its fine
     
  16. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007
    #16
    Seems to me that Firefox will not accept shortcuts that are setup in System Preferences - Keyboard Shortcuts
     
  17. covertsurfer thread starter macrumors 6502a

    Joined:
    Jan 18, 2007

Share This Page