Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;SQ11 mini camera time setting script
- ;written and tested on ahk version 1.1.29.00 by Mgis
- ;this short script sets time inside a textfile stored on removable drive of connected camera
- ;currently a bit comparing what is exactly in the file
- ;and not giving user a choice each time about watermark Y/N setting, you can set it here in the script.
- ;--------------------------------------
- ;--------------------------------------
- ;please just set next line accordingly to your drive
- file = E:\TIMEREST.TXT
- ;here you can set if you want N or Y option to be written
- yesorno=N
- ;--------------------------------------
- ;--------------------------------------
- #SingleInstance force
- replace:=false ;variable, if the contents seem to be bad
- if FileExist(file) {
- Loop, read, %file% ;using reading loop
- {
- ;this is the timestamp which appears in the file when connected to pc, it seems hardcoded somehow in firmware of camera
- ;it gets reset there every time.
- if A_LoopReadLine contains 20180115235959
- replace:=true ;then we can overwrite it without a doubt
- Break
- }
- } else {
- MsgBox,48,,File %file% doesnt seem to exist`nPlease check connection, drive letter, or in-script configured path to the file.
- ExitApp
- }
- if replace {
- GoSub,replace
- } else {
- MsgBox,File exists but contents do not contain recognized text
- ;at this point we could parse and compare the timestamp from file with current time
- ;but its shorter for this script to just show those and ask user
- ;Read text file into Var.
- FileRead, allcontents, %file%
- MsgBox,% 4+32,Answer me this,Not replacing.`n`nDo you want to replace anyway?`n`nCurrent contents:`n%allcontents%`n`nNew timestamp:`n%A_Now% %yesorno%
- ;replacing anyway?
- ifmsgbox,yes
- GoSub,replace
- }
- Sleep 2000
- ExitApp
- return ;end of autoexec section
- replace:
- FileDelete,%file%
- ToolTip, File deleted
- Sleep 1500
- FileAppend,%A_Now% %yesorno%,%file%
- ToolTip,Successfully set time`n`n%A_Now% %yesorno%
- return ;replace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement