topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Tuesday January 25, 2022, 2:37 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: Create ini from content folder : shortcuts, folders, any first level file.  (Read 542 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,787
    • 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,787
    • 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: 376
  • Call me Vic!
    • View Profile
    • PublicDomain.is
    • Read more about this member.
    • 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!
✔️ New releases: PublicDomain.is (coming soon, powered by pdMultisite)

🎁 One-time support: Paypal @ www.paypal.com/paypalme/victorvls

❤️ Steady support: Patreon @ www.patreon.com/publicdomain

Thanks & keep on rocking!
Email/Paypal: publicdomainvicgmail.com

Coding: GingerTG v0.1.0
--Victor

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,787
    • 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,787
    • 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: 376
  • Call me Vic!
    • View Profile
    • PublicDomain.is
    • Read more about this member.
    • 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!
✔️ New releases: PublicDomain.is (coming soon, powered by pdMultisite)

🎁 One-time support: Paypal @ www.paypal.com/paypalme/victorvls

❤️ Steady support: Patreon @ www.patreon.com/publicdomain

Thanks & keep on rocking!
Email/Paypal: publicdomainvicgmail.com

Coding: GingerTG v0.1.0
--Victor

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,787
    • 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: 376
  • Call me Vic!
    • View Profile
    • PublicDomain.is
    • Read more about this member.
    • 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:
✔️ New releases: PublicDomain.is (coming soon, powered by pdMultisite)

🎁 One-time support: Paypal @ www.paypal.com/paypalme/victorvls

❤️ Steady support: Patreon @ www.patreon.com/publicdomain

Thanks & keep on rocking!
Email/Paypal: publicdomainvicgmail.com

Coding: GingerTG v0.1.0
--Victor
« Last Edit: January 18, 2022, 05:42 PM by publicdomain »

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,787
    • 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,787
    • 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,787
    • 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,787
    • View Profile
    • Donate to Member