-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
[SUPPORT] Moving / renaming media files with QOwnNotes scripting #3205
Comments
Those functions were never made for writing binary files, see https://www.qownnotes.org/scripting/methods-and-objects.html#reading-text-from-a-file. Better use |
Thanks for your reply @pbek I tried accommodating the changes you suggested but for some reason the terminal command doesn't seem to be wanting to execute via the script (although does if I manually execute the command from the logs it does work as expected: Logs:[Jan 07 11:57:41] [scripting]: Starting insertMediaHook Code
When I used the full path to cp
Are there additional environmental settings I should be making? |
Why don't you try
As long as those commands are their own binary, no. If they are a feature of your shell, you need to run your shell with the commands. |
I tried mv as well, for some reason in my case the arguments aren't being passed out of startSynchronousProcess correctly. I am just going to make a shell script to loop through and do it with a cron job. |
Question
How could I move / rename a media file with the scripting function in QOwnNotes.
I have a question regarding when pasting an image from the clipboard. Instead of the default action of pasting the image and it saving to the ./media folder with a file name similar to
qownnotes-media-.*\.png$
I would like to name it using the file name it is being pasted into with a suffix of "whichever number of screenshot".I think this helps organize the media folder a bit more.
Here is an attempt I made but it is reading the original file and writing the new file as text instead of a binary.
Relevant log output in the Log panel
When I printed the log of the file it is obviously non-sensical:
Any clues would help even.
Thank you in advanced!
The text was updated successfully, but these errors were encountered: