topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday December 13, 2024, 12:34 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

Last post Author Topic: Create ini from content folder : shortcuts, folders, any first level file.  (Read 23094 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I would a AHK script for scan a target folder .

This is the target folder :
AsusPortatil - 02_01_2022 , 15_19_56.pngCreate ini from content folder : shortcuts, folders, any first level file.

Then create or add lines to an ini file of this type :
Launcher.ini



This launcher ini is an incomplete example, but the method is always the same

By example :
1. If an url is found in the target folder create the entry in the launcher.ini as
Title7=title of the url in the shortcut
Path7=https://www.donationcoder.com/forum/index.php?action=post;board=71.0
2. If an executable is found in the target folder :
Title19=Ducto_V2_1_3.exe - Acceso directo
Path19=C:\DUCTO\Ducto_V2_1_3.exe
3. If a path to al folder is found
Title25=Don Quijote de la Mancha - Acceso directo
Path25=P:\Escritorio\Don Quijote de la Mancha

4. If a folder is found
Title30=Software Integration
Path30=P:\Escritorio\Folder Ini Generator\Software Integration

and so on to totally scan the folder.
It's not necessary scan the subfolders.

Can you do a coding snack ?

Best Regards
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I don't see the ini file inserted.

so I try directly with a spoiler

[General]
numRows=25
numCols=9
[Titles]
Title1=Anti sistema y mentiras
Title2=Operación Retorno
Title3=COVID Control y seguimiento
Title4=Procedimientos Proyecto
Title5=Procedimientos Informáticos
Title6=Procedimientos Comunes
Title7=
Title8=
Title9=
Title10=
Title11=
Title31=PANTALLAZOS MES
Title12=
Title13=
Title14=
Title32=IMÁGENES MES
Title40=
Title30=
Title21=
Title22=
Title23=
Title24=
Title20=
Title33=CRONO MES
Title39=MENÚ GENERAL
Title38=MENÚ BUSCAR
Title37=MENÚ ATAJOS
Title25=
Title26=HW.tdl
Title27=Ocio.tdl
Title28=Rutinas.tdl
Title29=
Title19=
Title18=
Title15=
Title34=
Title35=practicar.tdl
Title36=Posicionar.tdl
Title16=LENGUAJES.TDL
Title17=
Title41=
Title42=
Title49=carpeta MAPAS MENTALES y dos en Y:
Title48=carpeta MENUS WORD y mm en M:
Title47=MENUS WORD 2
Title46=Organización Cuidados
Title43=Crear.tdl
Title44=NOProcrastinar
Title50=Actos Secundarios
Title45=45
Title125=Cerrar los menús
Title76=DEUDAS y Su seguimiento
[Paths]
Path1=Y:\PORTABLES\Personaliza pc\menu MENTIRAS\menuak.ahk
Path2=Y:\PORTABLES\Personaliza pc\menu RETORNO\menuak.ahk
Path3=Y:\PORTABLES\Personaliza pc\Menu COVID\menuak.ahk
Path4=Y:\INFORMATICA AYUDAS y FORMACION\Excel Ayuda\Control General\Gabinete\Procedimiento Proyectos.xls
Path5=Y:\INFORMATICA AYUDAS y FORMACION\Excel Ayuda\Control General\informatica\procedimientos informáticos.xls
Path6=Y:\INFORMATICA AYUDAS y FORMACION\Excel Ayuda\Control General\conta\procedimientos comunes.xls
Path7=
Path8=
Path9=
Path10=
Path11=
Path31=Y:\PORTABLES\Personaliza pc\Menu Actos Iniciales\send win+5.ahk
Path12=
Path13=
Path14=
Path32=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\AA\My Exes\AbrirMultimediaDirecto.exe
Path40=
Path30=
Path21=
Path22=
Path23=
Path24=
Path20=
Path33=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\AA\My Exes\AbrirActividadesDirecto.exe
Path39=Y:\PORTABLES\Personaliza pc\menuakAtajos\005.MenuBTylanzadera\menuak.ahk
Path38=Y:\PORTABLES\Personaliza pc\MenuakBUSCAR\menuak.ahk
Path37=Y:\PORTABLES\Personaliza pc\menuakAtajos\menuak.ahk
Path25=
Path26=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\HW.tdl
Path27=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\OCIO.tdl
Path28=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\Rutinas.tdl
Path29=
Path19=
Path18=
Path15=
Path34=
Path35=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\practicar.tdl
Path36=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\Posicionar.tdl
Path16=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\LENGUAJES.tdl
Path17=
Path41=
Path42=
Path49=M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm
Path48=M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm
Path47=M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm2
Path46=M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Organizacion Cuidados
Path43=Y:\GABINETE\PROYECTOS\MODELOS\CONTROL\TaskLists\Crear.tdl
Path44=M:\Documents and Settings\JOSE\Escritorio\Utilidades Varias\mm\Organizacion psico\NOProcrastinar.mm
Path50=Y:\PORTABLES\Personaliza pc\Menu Actos Secundarios\menuak.ahk
Path45=ERROR
Path125=O:\Mis documentos en O\SCRIPTING\cerrarmenus\Cerrarahk.ahk
Path76=ERROR

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
I would a AHK script for scan a target folder .

Hello dear Contro! If you are OK with a traditional program instead of an AHK script, I have no problem in taking your request  :)

Cheers & happy 2022!
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Of course.
I will finally use the ini file with a ahk script, but the method of obtaining the ini is entirely optional with any other method.
I think the best way for the ini file is create in the same target directory to be scanned.
This is really no problem because if the paths are complete I can move that ini file anywhere.

Best Regards
 :-* :P

Note : I see your answer yesterday and was thinking about improving any detail, but I don't really knows. Because even in the case I need rescan the folder I can do by deleting the ini file and do again.
 :-[ :-*


Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I am trying this with no interaction at all.
:


Spoiler
ini := StrReplace(A_ScriptFullPath, ".ahk", ".ini"), path := {}
IniRead, titles, %ini%, Titles
IniRead, paths, %ini%, Paths
For each, line in StrSplit(titles, "`n")
 If ((part := StrSplit(line, "=")).2 > ""
  && RegExMatch(paths, "m`a)" StrReplace(part.1, "Title", "Path") "=\K.+", commandLine)
  && path[part.2] := commandLine)
   Menu, menu, Add, % part.2, Go

F3::Menu, menu, Show ; F3 = Show the menu

Go:
Run, % path[A_ThisMenuItem]
Return


 :-* :P

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Hello dear Contro, I'm completing BGGfetch for mouser; right after doing it, I proceed to devote the time to this snack to publish it :Thmbsup:

Cheers!
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Hello dear Contro, I'm completing BGGfetch for mouser; right after doing it, I proceed to devote the time to this snack to publish it :Thmbsup:

Cheers!
Running to see BGGfetch too. I can wait.
 :-* :P

The only thing don't stopping is learning.

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Hello dear Contro, I'm completing BGGfetch for mouser; right after doing it, I proceed to devote the time to this snack to publish it

Hello again :) BGGfetch is feature-complete yet freezes randomly (we'll get there!)

Okay! I'm devoting time & love to your code. Repo is @ https://github.com/p...main/ini-a-la-contro

I understand the format for [Titles] and [Paths], yet would like you to clear up [General]:

[General]
numRows=25
numCols=9

Should it be included in your program's INI output?

Thanks :up:
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: January 18, 2022, 05:42 PM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Hello dear Contro, I'm completing BGGfetch for mouser; right after doing it, I proceed to devote the time to this snack to publish it

Hello again :) BGGfetch is feature-complete yet freezes randomly (we'll get there!)

Okay! I'm devoting time & love to your code. Repo is @ https://github.com/p...main/ini-a-la-contro

I understand the format for [Titles] and [Paths], yet would like you to clear up [General]:

[General]
numRows=25
numCols=9

Should it be included in your program's INI output?

Thanks :up:


what do you mean by this : Should it be included in your program's INI output?

I wish to obtain the ini file accoding the initial sintax.
In one side the numbered titles
in the other side the numbered paths

Don't worry about any other data. But If you wish then in the general the number of rows by the number of columns must be superior to the number of titles by path

By example : suppose I try to processs folder with 69 elements or icons.
Then I will need a menu with 69 elements.  A general of 25x9 is enough.
You don't need to put a zero or modify....

I am expecting your script to control very long troubles or themes or subject.
Imagine the coronavirus

Is not my work, but is not an easy subject. I am generating aspects and investigation every day for my own use. i usually follow the stadistics. But the I want a folder to document the history of vaccines. Other for why now in Spain are not the vaccines mandatories or not obligatories. And I want to investigate that.
And in two weeks I want and additiones folder to control de "cepas" (I know you understand spanish ....  ;D) .
And in two years I will have two more folders to take care or analize other aspects. So is a configurable menu that develops in time.
 :-* :P

And based in the most simple : the icons in a folder.....

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Is also in my side take care of how I want the titles and I can control renaming the name of the files inside the folder.....
I prefer a menu with options pending of using in the future. Thats why I put 25x9 rows and columns.
Besides I can edit by myself in any moment the ini file. Besides the original ahk script control the ini and its size with other method. So is better for you not configure the number of rows and columns.

 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I can made backups or even summatory or adding menus taking care of the ini file or using a renaming utility like that of lopesoft.
So don't worry about that too.
I am going now to take a look to your code.
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Hola! You program's almost ready to release.

Screenshot from 2022-01-26 23-29-29.png

I'm only sorting .LNK files parsing since the oldie native parsing code I have doesn't compile on my current Linux setup (this is an edge case; I'm back to Windows + Visual Studio at a later time nonetheless, yet right now may have to do libLNK or similar).

Just wanted to reassure you I'm coding & about to release :up: Cheers!
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

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
... may have to do libLNK or similar).

Just found this lnk parser: https://formats.kait...lnk_file/csharp.html

Same CC0-1.0 license as we normally use :) Just confirming "INI a la Contro" is the next program/release :up:
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I'll take this evening a good look
Best Regards
 :-* :P

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
I'll take this evening a good look
Best Regards
 :-* :P

No worries, I'll publish & send a PM on release :up:
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
When When Wheeeeeeennnnnnnnnnnn !!!!!!!!
 ;D ;D ;D ;D ;D ;D :-* :-* :-* :P :P :P :P
 :o

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Perhaps I can help as a beta tester ?
 :-* :P

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
When When Wheeeeeeennnnnnnnnnnn !!!!!!!!

Your program is ready BUEN AMIGO; it is posted for beta testing.

Download: INIalaContro_BETA_2022-01-21.zip

https://github.com/p...a-la-contro/issues/2

Running on W7:



Perhaps I can help as a beta tester ?

Please do test. LNK implementation may produce exceptions on locales other than "en-US", so your beta testing is welcome since you are both the main tester & user.

...By all means download & report back. Let's try to have it officially complete to add it to January's releases thread  :up:

Cheers!
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I'll try tonight
Best Regards.
Now I go shopping food and a door closer
 ;D ;D ;D ;D
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
The program is reading the subfolders too. So when the target folder contains 23 elementos is converted to 330 elements. I don't see convenient when I can scan that subfolder in the future if I wish a submenu for that subfolder.

When save does as a txt file, not an ini file. And is save in the folder where the program is , not in the target folder.

Please, by defect, the number of rows and columns is the specified amount above 25 and 9. This is more suitable for me.

The name of the ini es launcher.ini

Notes :
You can improve in the future with the drag and drop option for the target folder and automate the generation of the launcher.ini in the same target folder.
If you wish to maintain the actual behavior then ignore the ini file launcher.ini when scannning the folder , and the executable of your script and menuak.ahk from autohotkey.
So I will copy your script and menuak.ahk and launcher ini in the target folder. AsusPortatil - 29_01_2022 , 20_34_17.pngCreate ini from content folder : shortcuts, folders, any first level file.
 :-* :P
AsusPortatil - 29_01_2022 , 20_34_17.pngCreate ini from content folder : shortcuts, folders, any first level file.AsusPortatil - 29_01_2022 , 20_34_38.pngCreate ini from content folder : shortcuts, folders, any first level file.AsusPortatil - 29_01_2022 , 20_36_31.pngCreate ini from content folder : shortcuts, folders, any first level file.
« Last Edit: January 29, 2022, 02:56 PM by Contro »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
I think the very best is put the main executable in the target folder, with the launcher.ini and menuak.ahk also in the target folder
Then the browse option may be faster and generate the ini file almost in th same fact.
When ini a la contro scans the folder ignore the system hidden files, and those three mention before.
the ini file is with 25 rows and 9 columns.
the name is launcher.ini
you can create a backup ini file if you want. Bak files are not scanned.
 :-* :P

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Perhaps you don't need the parser. In windows is possible to link to the lnk file and open the url....
 :-* :P

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 736
  • Call me Vic!
    • View Profile
    • Donate to Member
Suggestions noted for next version 👍
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

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member

Suggestions noted for next version 👍
Unfornately the beta version is not usable.
It's not necessary to scan the subfolders as I told you.
I don't need to scan the subfolders

Lamentablemente con la versión beta no puedo hacer absolutamente nada.
No es necesario escanear las subcarpetas.
De hecho cada subcarpeta tiene demasiados enlaces y no son practicables en forma de menú. 

 :-* :P