Powershell vs AutoHotKey

Discuss other programming languages besides AutoHotkey
usser
Posts: 143
Joined: 22 Oct 2014, 13:03

Powershell vs AutoHotKey

21 Jun 2016, 04:03

Hello!

How does Powershell compare with Autohotkey? Is it more powerful/flexible or less?

I am interested in Powershell because it is available in ALL Windows PCs, you can use it at work with no worries about licence issues and you can use it in workstations where installing third-party tools like AHK is blocked.

Thanks!
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Powershell vs AutoHotKey

21 Jun 2016, 04:15

Its hard to compare, and both has pro's and con's, but with powershell you cant use things like:
- MouseMove / MouseClick
- Send / SendRaw / SendInput / SendPlay
- Create and Control Gui's
- tba...

A. There is no licence issue with AutoHotkey since its free and opensource
B. There is no need to install AutoHotkey to work with it
C. Many companies blocks powershell (via GPO) for user inputs for security reasons
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
usser
Posts: 143
Joined: 22 Oct 2014, 13:03

Re: Powershell vs AutoHotKey

21 Jun 2016, 04:54

Mmm this is great disadvantage, so you cannot click stuff with Powershell? Are you sure?
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Powershell vs AutoHotKey

21 Jun 2016, 05:02

You can, but you need DllImport and its more complicate than in autohotkey
Use PowerShell to Interact with the Windows API: Part 1
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Powershell vs AutoHotKey

29 Jun 2016, 07:19

You can run Powershell scripts from an AHK script using RunWait.
If you need to read back into AHK what PS printed at the command-line, use the RunWaitOne() function which can be found on the documentation page for RunWait

So write your main script in AHK, and stuff that is not possible or is a pain to do with AHK, simply call a PS script to do it.

Bear in mind you can also use AHK's FileInstall command to pack a powershell script inside a compiled AHK script - so you do not need to distribute the AHK script and the PS script - simply compile the AHK script and the PS script is bundled inside the EXE
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: Powershell vs AutoHotKey

03 Jul 2016, 10:31

Where is Powershell stronger than AutoHotkey? When it is better to use Powershell instead of AutoHotkey?
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
Guest

Re: Powershell vs AutoHotKey

25 Aug 2016, 03:13

And now Powershell is cross platform and Open Source as well:

News: Microsoft PowerShell Goes Open Source, Arrives On Linux, Mac
http://www.informationweek.com/devops/p ... id/1326670

Source:
https://github.com/PowerShell/
newbee

Re: Powershell vs AutoHotKey

25 Oct 2016, 10:00

can I use AHK scripting in powershell?
I don't really see the point in typing two lines of scripting commands if I need to paste in 3 word sentence repeatedly. can I make in powreshell (same like AHK) two-three key combination and the text comes up?
und

Re: Powershell vs AutoHotKey

25 Oct 2016, 10:07

so, if I can use PowerShell scripts in AHK, can I write AHK scripts and transfer them to PowerShell?
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Powershell vs AutoHotKey

25 Oct 2016, 14:15

Define "transfer to powershell"

You can run an AHK script from powershell, just like you can run an AHK script from the command-line

You could have a string in powershell which contains AHK code, then either:
Pipe it to a text file, then run it as normal.
Or
Use Autohotkey.dll to run AHK code dynamically

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 23 guests