Skip to content

Python return string to macro ends with insertText in Messages #37

Description

@noste99

In Krita I copied part of a drawing to the clipboard. In a TexStudio current .tex document with the cursor somewhere in the text I want to launch a Python script. For launching the python script with the system command, the filename of the current .tex document must be past as argument. The python script converts the clipboard content in a .page file saved with the name based on the current .tex document filename passed as argument to the command line. The filename of the .png file needs to be embedded in a TeX \include graphics command. This command is returned to the calling macro who takes the return string and uses it as argument of the editor.insertText command. This command should insert the string in the current .tex document at the cursor position where the macro was launched. The result is that the ProcessX id is inserted in the .tex file but not the text string. After enforcing the focus to the editor, waiting until the python script finished etc I was able to print the string but not in the current .tex document. It ended on the Messages box/log. Sending the same string as argument of the alert command opens the alert box but the string was not printed. The string is not containing special characters or LF etc. What am I doing wrong or is this a bug in the editor.insertText command of the macro?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions