Created attachment 202967 [details] code that shows the dialog appearing with the incorrect search path Version: 24.2.7.2 (X86_64) / LibreOffice Community Build ID: 420(Build:2) CPU threads: 8; OS: Linux 6.14; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Ubuntu package version: 4:24.2.7-0ubuntu0.24.04.4 Calc: threaded Hi - The search path isn't working. In this dialog url notice how i have to specify application=location to get the dialog to appear. It won't work with application=user. Gemini and ChatGPT indicate that the process is not cool because if I am not the administrator I won't be able to do my own scripts in a small business/corporation being that only the system admin will have access to the system-wide profile. Some relevant file paths- system-wide /usr/lib/libreoffice/share/basic local /home/funnysys/.config/libreoffice/4/user/Standard and /home/funnysys/.config/libreoffice/4/user/Standard/dialogs I have the dialog under Standard library in Tools -> Macros -> Organize Dialogs -> Dialogs when i press Tools -> Macros -> Organize Python Scripts -> select script then Execute it will work only if location=application as in the attached code file found with this line DIALOG_URL = "vnd.sun.star.script:Standard.Dialog1?location=application" then the dlg will appear. Please let me know if this is something you may look into in the future. It may help me choose to start developing with macros even though the search path is currently funny. I will be encouraged to start anyway. thanks so much - j.
one of the people in the forum didn't like the designation search_path and thought it might be confusing here is what the ai had to say about that... just trying to clarify with the help of ai on the terms thanks Based on the code provided, the dialog_url is specifically and explicitly set to search the location=application path. This means that the macro will look for the Standard.dialog1 dialog in the shared, system-wide installation folder, not the user's personal macro directory. The dialog_url defined in the code is: dialog_url = "vnd.sun.star.script:standard.dialog1?location=application" Here is a breakdown of why this is important: vnd.sun.star.script:: This is the protocol for accessing macros and dialogs stored within the LibreOffice/OpenOffice environment. standard.dialog1: This specifies that the macro is looking for a dialog named dialog1 within a macro library named standard. ?location=application: This is the critical component. It is a query parameter that restricts the search for the Standard library to the "application" installation directory. The effect on the "search path" Your base macro developers should see that your code explicitly dictates a specific search location, which would bypass the typical "search path" order (user, application, document) that might be expected. This is a common source of confusion for users trying to get dialogs to work, especially when the dialog has been saved in the user's personal macro directory. For the code to work with a dialog stored in a user's profile, the dialog_url would need to be changed to: dialog_url = "vnd.sun.star.script:standard.dialog1?location=user". Clarification on unohelper and xDialogEventHandler The rest of the code, which uses unohelper.base and xDialogEventHandler, sets up a Python-based dialog handler. This is standard and correctly implemented UNO API usage. However, it does not influence the search path defined by the dialog_url. The location=application parameter is the sole and definitive part of the code that restricts where the dialog is sought.