About CHDK scripting and pictures files name renamed - Script Writing - CHDK Forum
supplierdeeply

About CHDK scripting and pictures files name renamed

  • 5 Replies
  • 3114 Views
About CHDK scripting and pictures files name renamed
« on: 17 / March / 2013, 07:16:45 »
Advertisements
good morning to all of you
I'm new entry into the forum
(.... I apologize in advance for not good english)

Could you suggest me how to have the function to rename photo files name taken with CHDK?

for example, to create a series of photos where the auto-increment counter is reset to an initial value of 1 after taking 100 pictures

Thank you very much in advance

Re: About CHDK scripting and pictures files name renamed
« Reply #1 on: 17 / March / 2013, 11:11:07 »
Could you suggest me how to have the function to rename photo files name taken with CHDK?  For example, to create a series of photos where the auto-increment counter is reset to an initial value of 1 after taking 100 pictures
You will need to write a Lua script to do this,  using the os.rename function.   There is a little information about that here :  http://chdk.wikia.com/wiki/Lua#General_notes_from_IO_and_OS_testing_on_vxworks  and

http://www.lua.org/manual/5.1/manual.html#5.7
« Last Edit: 17 / March / 2013, 11:17:20 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: About CHDK scripting and pictures files name renamed
« Reply #2 on: 18 / March / 2013, 04:31:59 »
Thank you  - waterwingz - for your reply and your suggest

Re: About CHDK scripting and pictures files name renamed
« Reply #3 on: 18 / March / 2013, 04:37:43 »
Do you confirm that I can write a LUA file with standard TXT editor?

Thanks


Re: About CHDK scripting and pictures files name renamed
« Reply #4 on: 18 / March / 2013, 06:59:33 »
yes, standard txt editor. Do not use feature-full stuff like Word or something. Just plain txt:)

Remember that you HAVE TO rename the file so it has .lua extension. Otherwise it will be recognized as ubasic script ant it won't run.

CHDK has built-in text editor, but writting a long text in it would be painfull...:)
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: About CHDK scripting and pictures files name renamed
« Reply #5 on: 18 / March / 2013, 07:03:39 »
In principle, yes. An editor with syntax highlighting and block markers is better, e.g. notepad++.

One note: If you rename a standard image file (img_nnnn.jpg) you lose the camera preview function for this file. That means you can not see the renamed file in play mode.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics