Posts: 1,032
Threads: 246
Joined: Jul 2022
Hi,
Sometimes I need to encrypt/decrypt a lot of QM item files and folders, it's a bit cumbersome to manually manipulate the options in the image below, is there a related function that can do the same?
Thanks in advance for any advice and help
david
Posts: 12,075
Threads: 141
Joined: Dec 2002
Posts: 1,336
Threads: 61
Joined: Jul 2006
02-11-2023, 03:44 PM
(This post was last modified: 02-11-2023, 04:23 PM by Kevin.)
there is this function to automate encrypt decrypt
Function
EncryptDecryptMacro
;/
function encrypt ~password [$macro]
;Automates encrypting or decrypting a macro or other QM item.
;encrypt - 1 to encrypt, 0 to decrypt.
;password - password.
;macro - name of the macro. If "" or omitted - macro that is currently open.
;EXAMPLES
;EncryptDecryptMacro 1 "password" ;;encrypt current macro
;EncryptDecryptMacro 0 "password" ;;decrypt current macro
;EncryptDecryptMacro 1 "password" "Dialog33" ;;encrypt Dialog33
int w1=act(win("" "QM_Editor")) ;;activate QM
if(len(macro))
,int currentmacro=qmitem
,mac+ macro ;;open the macro, if specified
int w2=win("Options" "#32770" "qm") ;;is Options already open?
if(w2) ;;yes, remember that
,int optionsopen=1
else ;;no, open it
,men 2007 w1 ;;Options ...
,w2=wait(5 win("Options" "#32770" "qm"))
SelectTab id(12320 w2) 4 ;;select Security tab
password.setwintext(id(1051 w2)); password.setwintext(id(1053 w2)) ;;enter password
but iif(encrypt 1106 1107) w2 ;;click Encrypt or Decrypt button
if(!optionsopen) but 2 w2; wait 10 -WC w2 ;;close
if(currentmacro) mac+ currentmacro ;;open current macro again
err+ end _error
Posts: 1,032
Threads: 246
Joined: Jul 2022
the window blinks during execution, can the options dialog box not be displayed? (Or display in the background or virtual window?)
Posts: 1,336
Threads: 61
Joined: Jul 2006
No this is the only way have to automate options dialog window
Posts: 1,032
Threads: 246
Joined: Jul 2022
worked well, thank you so much