New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add script noteTextEditReplace #902

Closed
vanleo2001 opened this Issue Apr 27, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@vanleo2001

vanleo2001 commented Apr 27, 2018

In QON qml script, noteTextEditWrite will append the text. But I need a script noteTextEditReplace, which can replace all the text in current note. Can you add it?

@pbek pbek added the question label Apr 27, 2018

@pbek

This comment has been minimized.

Owner

pbek commented Apr 27, 2018

You could do that by using writeToFile to write to the currentNote().fullNoteFilePath. The note text you can find in currentNote().noteText. And you can replace text with text = text.replace("your text", "replaced text"); (see: https://www.w3schools.com/jsref/jsref_replace.asp).

@pbek

This comment has been minimized.

Owner

pbek commented May 1, 2018

18.05.0

  • there now is a new scripting command script.noteTextEditSelectAll() to
    select all text in the note text edit
    • you can use this together with script.noteTextEditWrite() to overwrite
      the whole text of the current note
    • for more information please take a look at the scripting documentation

@pbek pbek added this to the 18.05.0 milestone May 1, 2018

@pbek pbek added the enhancement label May 1, 2018

@pbek pbek changed the title from Feture Request: add script noteTextEditReplace to Feature Request: add script noteTextEditReplace May 1, 2018

@pbek

This comment has been minimized.

Owner

pbek commented May 1, 2018

There now is a new release, could you please test it and report if it works for you?

@pbek pbek closed this May 5, 2018

@pbek pbek removed the question label May 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment