topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday April 23, 2024, 6:11 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: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini  (Read 2876 times)

publicdomain

  • Moderator
  • Joined in 2019
  • *****
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Surprise release! (Not even I knew it would be finished today :))

Code: Autohotkey [Select]
  1. ; INIalaContro.ahk
  2. ; Made for: Contro
  3. ; Thread: https://www.donationcoder.com/forum/index.php?topic=52258.0
  4. ;
  5. ; Author: publicdomainvic
  6. ; License: CC0 1.0 Universal - Public Domain Dedication
  7. ; Website: https://publicdomain.is
  8.  
  9. ; Get folder
  10. Folder := RegExReplace(Folder, "\\$")
  11.  
  12. ; Open Launcher.ini for write
  13. file := FileOpen(Folder . "\\Launcher.ini", "w `n")
  14.  
  15. ; Write header
  16. file.WriteLine("[General]")
  17. file.WriteLine("numRows=25")
  18. file.WriteLine("numCols=9")
  19. file.WriteLine("[Titles]")
  20.  
  21. ; Set paths array
  22. pathArray := Array()
  23.  
  24. ; Loop files and folders
  25. Loop, Files, %Folder%\*.*, FD
  26. {
  27.  
  28. ; Split the path
  29. SplitPath, A_LoopFileLongPath, OutFileName, OutDir, OutExtension, OutNameNoExt, OutDrive
  30.  
  31. ; Process lnk and url
  32.         {
  33.         Case "lnk":
  34.                 FileGetShortcut, %A_LoopFileLongPath%, OutTarget
  35.                 file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
  36.                 pathArray.Push(OutTarget)
  37.         Case "url":
  38.                 IniRead, ExtractedURL, %A_LoopFileLongPath%, InternetShortcut, URL
  39.                 file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
  40.                 pathArray.Push(ExtractedURL)
  41.         Default:
  42.                 file.WriteLine("Title" . A_Index . "=" . OutNameNoExt)
  43.                 pathArray.Push(A_LoopFileLongPath)
  44.         }
  45. }
  46.  
  47. ; Print paths
  48. file.WriteLine("[Paths]")
  49.  
  50. ; Loop paths array for write
  51. for index, element in pathArray
  52. {
  53.     file.WriteLine("Path" . index . "=" . element)
  54. }
  55.  
  56. ; Close the file
  57. file.Close()
  58.  
  59. ; Advise user
  60. MsgBox Launcher.ini created!

INIalaContro.ahk file attached.
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 23, 2022, 04:51 AM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #1 on: April 18, 2022, 04:25 AM »
 ;D :-* :P

Running to try !!!!!1
« Last Edit: April 23, 2022, 04:51 AM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #2 on: April 18, 2022, 04:33 AM »
 ;D

I think you are specially inspired !!!!!!!!!!!

 :-* :P
« Last Edit: April 23, 2022, 04:51 AM by publicdomain »

publicdomain

  • Moderator
  • Joined in 2019
  • *****
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Re: INIalaContro.ahk - AutoHotkey script to generate Launcher.ini
« Reply #3 on: April 18, 2022, 10:38 AM »
Glad you liked it :up: I'm happy to help :)
My name's Victor but do feel free to call me Vic! (now known as "paradisusvic")

❤️ Support on Patreon @ www.patreon.com/paradisusis
New Email/Paypal: paradisusvicgmail.com
« Last Edit: April 23, 2022, 04:52 AM by publicdomain »