Name of saved file after 'shoot' command

  • 2 Replies
  • 785 Views
Name of saved file after 'shoot' command
« on: 14 / June / 2014, 04:21:47 »
Advertisements
Hello all!
I am writing some scripts in ubasic and getting some very interesting results, particularly with interval shooting and long time exposures.
I want to know how to find the filename as stored on the camera of the last shot I took so I can add it to my log file captured with print_screen XX. This is for identifying which picture was taken with which settings as it were.
I have seen some lua files that have very cryptic looking references to os. functions but I haven't quite climbed that mountain yet!
You would think it would be easy, but I can't find any references apart from the lua ones mentioned above.
Does anybody know anything about this?

*

Offline zeno

  • *****
  • 882
Re: Name of saved file after 'shoot' command
« Reply #1 on: 14 / June / 2014, 10:20:40 »
Hi Jeremy
Since ubasic only has integer variables, you can't get hold of filenames in ubasic scripts - you have to use lua.

A long time ago I wrote some extensions to ubasic to handle strings and added some functions to do the sort of thing you want, but nobody was very interested since lua had already been added to CHDK and offered much more capability.

So you'll have to bite the bullet!

Dave
A570, S100, Ixus 127
Author of ASSIST, STICK, WASP, ACID, SDMInst, LICKS, WICKS, MacBoot, UBDB, CFGEdit

Re: Name of saved file after 'shoot' command
« Reply #2 on: 14 / June / 2014, 10:24:54 »
Or you could try something like this :

Code: [Select]
@title Dater
sleep 2000
shoot
print "IMG_";get_exp_count;".JPG"
end

FYI .. this wiki page can be really handy when learning scripiting - uBASIC or Lua.
link> CHDK Scripting Cross Reference Page
Scroll down to see the list of scripting functions.
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics