topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Sunday December 1, 2024, 11:26 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Trying to create Steam game shortcuts with AHK  (Read 7357 times)

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Trying to create Steam game shortcuts with AHK
« on: April 06, 2017, 12:18 AM »
I ran across a tutorial to create shortcuts that can be pinned to the windows 10 start menu for steam games without using third party apps.
I wanted to automate this process using AutoHotKey, however when I get to the part where the script actually creates the shortcut, it creates a shortcut with a blank file location.
the file location has to be "%windir%\explorer.exe steam://rungameid/1234"
in my script, I am using
FileCreateShortcut, explorer.exe steam://rungameid/%Sname%, %Gname%.lnk,,,,%IcoLoco%
which creates a shortcut with a blank file location.
Is there any way that I can get this to work? I only know how to code in AHK, so switching to a different program language isn't an option for me, because I rarely make apps, so I don't really want to learn a whole new language just for one simple app.
Any help would be greatly appreciated.
[Insert really cool signature here]

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #1 on: April 06, 2017, 12:40 AM »
Never mind, I figured it out.
FileCreateShortcut, explorer.exe, %Gname%.lnk,,steam://rungameid/%Sname%,,%IcoLoco%
I had no clue what the Args option was, so I messed around with it for a bit, and figured out how to get it to work.
[Insert really cool signature here]

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #2 on: April 06, 2017, 03:40 AM »
^^ Well done and thankyou! I had exactly the same need, and you have just shown a useful solution.    :Thmbsup:

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #3 on: April 06, 2017, 05:23 AM »
yeah, it annoyed me that you couldn't pin steam games to the start menu. I pin all my apps on the start menu in labeled groups to keep my desktop organized.
here is the website with the tutorial in case you need it.

InputBox, Sname, Input Steam Shortcut, Type in the gameid here.
if ErrorLevel
ExitApp
else
MsgBox, Next, select the icon for the shortcut.
FileSelectFile, IcoLoco
if IcoLoco =
ExitApp
else
InputBox, Gname, Input Game Name, Type in the game's name here.
if ErrorLevel
ExitApp
else
FileCreateShortcut, explorer.exe, %Gname%.lnk,,steam://rungameid/%Sname%,,%IcoLoco%
and the source code for my completed script for anyone in the same boat as me.
[Insert really cool signature here]
« Last Edit: April 06, 2017, 05:31 AM by nite_monkey »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #4 on: April 06, 2017, 07:22 AM »
There's also a very simple tool by skwire to do the same.

https://www.donation....msg242767#msg242767

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #5 on: April 06, 2017, 09:31 AM »
There's also a very simple tool by skwire to do the same.

https://www.donation....msg242767#msg242767
...Well that just destroys my app. Kind of wish I looked here first. I should have known one of the awesome DC coders would have written something for this.
[Insert really cool signature here]

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #6 on: April 06, 2017, 11:05 AM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,190
    • View Profile
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #7 on: April 06, 2017, 02:56 PM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

In my opinion, one of the cool things about making your own implementations, is that you can add your own tweaks.  There's also the satisfaction of doing it.  I was just pointing out that there was another one.  The advantage of your app is that you have the source, and can make adjustments, also.  Of course, the advantage of skwire's is you don't have to.  It's a tradeoff. :)

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
    • View Profile
    • Just Plain Super
    • Read more about this member.
    • Donate to Member
Re: Trying to create Steam game shortcuts with AHK
« Reply #8 on: April 07, 2017, 04:51 AM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

In my opinion, one of the cool things about making your own implementations, is that you can add your own tweaks.  There's also the satisfaction of doing it.  I was just pointing out that there was another one.  The advantage of your app is that you have the source, and can make adjustments, also.  Of course, the advantage of skwire's is you don't have to.  It's a tradeoff. :)
All excellent points. I may go back to mine and tweak it some later, but right now I am enjoying how simple and easy skwire's is.
[Insert really cool signature here]