I have never worked with an ini file and do not know how to create one so I tired a test script.
I recall reading on the forum that if the ini file doesn't exist Macro Scheduler will create it.
I created a empty file under program files and called it initest.
Then ran this test script.
EditIniFile>C:\Program Files\initest\myini.ini,usernames,user1,anyname
ReadIniFile>C:\Program Files\initest\myini.ini,usernames,user1,name
message>name
I ran this script several times.
When I run the script I get a message that the ini file does not exist.
Oddly on one occassion it displayed the name 'anyname'.
need help with ini files
Moderators: Dorian (MJT support), JRL
I don't know where you read that editIniFile> will create a file for you but I just tested it and it did not create one for me. However, you can easily create a new file using WriteLn>. The following line will create a new file that contains one blank line.
WriteLn>C:\Program Files\initest\myini.ini,result,
follow that with EditIniFile>
EditIniFile>C:\Program Files\initest\myini.ini,usernames,user1,anyname
and you should find a file C:\Program Files\initest\myini.ini that looks like this if viewed with notepad.
[usernames]
user1=anyname
The rest of your test script should produce a value of "anyname" for the variable "name"
ReadIniFile>C:\Program Files\initest\myini.ini,usernames,user1,name
message>%name%
Hope this is helpful,
Dick
WriteLn>C:\Program Files\initest\myini.ini,result,
follow that with EditIniFile>
EditIniFile>C:\Program Files\initest\myini.ini,usernames,user1,anyname
and you should find a file C:\Program Files\initest\myini.ini that looks like this if viewed with notepad.
[usernames]
user1=anyname
The rest of your test script should produce a value of "anyname" for the variable "name"
ReadIniFile>C:\Program Files\initest\myini.ini,usernames,user1,name
message>%name%
Hope this is helpful,
Dick