[Ma...] Posted January 11, 2023 Share Posted January 11, 2023 Good Morning, I tried to use this code to change dinamically the default folder for selecting files into a specific folder, but it dpoesn't work. Where it is wrong? codice=(gom.app.project.project_name).split("_")[0] print (codice) control_dir=str('S:\\QUAREP\\Controlli\\'+codice+'\\') print (control_dir) DIALOG=gom.script.sys.create_user_defined_dialog (content='<dialog>' \ ' <title>Scegli i files</title>' \ ' <style></style>' \ ' <control id="OkCancel"/>' \ ' <position>center</position>' \ ' <embedding>always_toplevel</embedding>' \ ' <sizemode></sizemode>' \ ' <size height="218" width="294"/>' \ ' <content columns="1" rows="2">' \ ' <widget row="0" columnspan="1" type="display::text" column="0" rowspan="1">' \ ' <name>text</name>' \ ' <tooltip></tooltip>' \ ' <text><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">' \ '<html><head><meta name="qrichtext" content="1" /><style type="text/css">' \ 'p, li { white-space: pre-wrap; }' \ '</style></head><body style=" ">' \ '<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt;">Scegli i files da controllare</span></p></body></html></text>' \ ' <wordwrap>false</wordwrap>' \ ' </widget>' \ ' <widget row="1" columnspan="1" type="input::file" column="0" rowspan="1">' \ ' <name>folder</name>' \ ' <tooltip></tooltip>' \ ' <type>multi_file</type>' \ ' <title>Choose File</title>' \ ' <default></default>' \ ' <limited>false</limited>' \ ' <file_types/>' \ ' <file_types_default></file_types_default>' \ ' </widget>' \ ' </content>' \ '</dialog>') DIALOG.folder.default = control_dir RESULT=gom.script.sys.show_user_defined_dialog (dialog=DIALOG) Thank you in advance! Link to comment Share on other sites More sharing options...
[Ma...] Posted January 11, 2023 Author Share Posted January 11, 2023 I found the solution: I have to go 1 step deeper in the folder, in a subdirectory of my code. So the variable control_dir must be ("S:\\QUAREP\\Controlli\\"+codice+"\\00_BF\\"). Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in