Jump to content

Workflow to invoke key strokes


Recommended Posts

I use SnagIt for Mac and would like to be able take a screenshot from within Alfred Workflow.

 

SnagIt already allows a keyboard shortcut to launch, but I'd like to be able to type "ss" in Alfred and have Control-Option-C trigger (which would then launch SnagIt).

 

Possible with a work flow?

Link to comment

I use SnagIt for Mac and would like to be able take a screenshot from within Alfred Workflow.

 

SnagIt already allows a keyboard shortcut to launch, but I'd like to be able to type "ss" in Alfred and have Control-Option-C trigger (which would then launch SnagIt).

 

Possible with a work flow?

 

Definitely, using AppleScript. In the workflows area, you would need to create a new workflow (use the Keyword to Script template,its under Essentials). Double click the keyword module, set your keyword 'ss' and the title and such. Double click the script module, set the language to osascript, and enter this in the script area:

tell application "Snagit" to activate
tell application "System Events" to keystroke "C" using {shift down, control down}

 

You may need to change the {shift down, control down} to match yours. I chose this based on the default shortcut for initiating a screenshot.

Link to comment
tell application "Snagit" to activate 
tell application "Finder" activate 
tell application "System Events" to keystroke "c" using {control down, option down} 
end tell

It wasn't working since the keystrokes don't get pressed in Snagit to get it to work. They are in the Finder.

 

By modifying your code example, I was able to create the workflow above.

 

This has the added bonus of not having to keep SnagIt running when it's not used, just open it when a screen grab is needed.

 

This will open up a whole new way to interact with apps on my Mac.

 

Thank you Alfred 2! (oh, yea, and jdfwarrior) ;)

Edited by harringg
Link to comment
tell application "Snagit" to activate 
tell application "Finder" activate 
tell application "System Events" to keystroke "c" using {control down, option down} 
end tell

It wasn't working since the keystrokes don't get pressed in Snagit to get it to work. They are in the Finder.

 

By modifying your code example, I was able to create the workflow above.

 

This has the added bonus of not having to keep SnagIt running when it's not used, just open it when a screen grab is needed.

 

This will open up a whole new way to interact with apps on my Mac.

 

Thank you Alfred 2! (oh, yea, and jdfwarrior) ;)

 

Interesting that it didn't work.. I downloaded and installed Snagit just to test it. Worked perfectly on my end.. Oh well, as long as you got it going thats great.

Link to comment
  • 10 months later...

Sry but for me its not working, if i try this i will be able to select it from the alfred hud but if i press ENTER nothing happens... 

 

i cant screenshot the alfred app, so i cant provide a screenshot :'(


tell application "Snagit" to activate 
tell application "System Events" to keystroke "c" using {shift down, control down} 
end tell

 

Shift and Control are right and C also, it is working without alfred and snagit is running. ...

Link to comment

Sry but for me its not working, if i try this i will be able to select it from the alfred hud but if i press ENTER nothing happens... 

 

i cant screenshot the alfred app, so i cant provide a screenshot :'(


tell application "Snagit" to activate 
tell application "System Events" to keystroke "c" using {shift down, control down} 
end tell

 

Shift and Control are right and C also, it is working without alfred and snagit is running. ...

 

You should be able to grab a screenshot of Alfred by pressing Cmd+Shift+4 while he is visible and then selecting the area that you wish to capture.

 

If Control+Shift+C is a global hotkey for accessing Snagit, then you probably don't have to activate it first. The code should still work regardless though. Is this code setup in a workflow with a hotkey and a run script item with the language set to osascript? Are the two connected together?

Link to comment

Oh ok, i think i missunderstood something. 

i wont press the keys for a screenshot, i will do it with alfred. Ctrl+shift+c is working well but i will open alfred and type a keyword for that because i do screenshots in very different ways every day and if that is working i can also generate keywords for capturing videos (newest version of snagit supports screencapturing video). 

 

Screen1

Screen2

Screen3

 

br

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...