I wonder if there is a way to get the script to dynamically change menu entries, eg in response to other menu choices.
The other question relates to running a script in the background, ie in non alt mode. Is there a way?
As an example, in the following menu I would like the script to always reset to 0 after the user selects yes. At the moment the user has to remember/know to reset the next time the script runs. @param e New Log File? @default e 0 @values e No Yes
While I don't think there is currently any easy way to edit those config files, you could do it the hard way with file i/o code in Lua. Alternatively, it might be a nice new bit of functionality to add to the CHDK implementation of Lua. Assuming I'm not missing something obvious that allows us to already do this...
@param e New Log File? @default e 0 @values e No Yes
if e == 1 then os.remove("A/CHDK/LOGS/LOG_2306.TXT") local fp = io.open ("A/CHDK/DATA/LBS.0","r") if fp == nil then return else local str = fp:read("*all") fp:close() str = string.gsub(str,"#e=1","#e=0") fp = io.open ("A/CHDK/DATA/LBS.0","w") fp:write(str) fp:close() print("Log deleted") return -- exit script endend
BTW had a look at the CHDK/DATA/scriptname.CFG associated with the script and all it contains is 0null.
Started by kwf General Discussion and Assistance
Started by kmboise Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by adapter9 General Help and Assistance on using CHDK stable releases
Started by waterwingz « 1 2 ... 60 61 » General Discussion and Assistance
Started by Sdack « 1 2 3 » General Discussion and Assistance