Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script-Fu in GIMP 3 website
#9
(04-29-2025, 06:59 PM)crogonint Wrote: Erg..

I had been trying to learn Script-fu to attempt t fix it myself, but that is not going well.
My heart skipped a beat when your link didn't work.
https://script-fu.github.io/funky/hub/pl...-Autosave/
Apparently the link has capital A's now.
I tried testing it, it didn't work for me.
It seems that it cannot create the "Autosave folder on my F drive..?
I created the folder for it.
I renamed it to "GIMP_Autosave".
I checked permissions.
I restarted GIMP to clear any error conditions.
I started GIMP "as Administrator" to see if that would help.

I tried to attach an image for you, but it erased my reply here, so I'm going to post this reply, then try to post the screenshot below...

Yeah, it won't let me attach a screenshot. here is the text of the errors it throws:
 GIMP Error
Execution error for procedure 'gimp-xcf-save':
Error creating 'F:\Images\GIMP_Autosave\Concordia[720x720]\autosave_1.xcf': Error opening file “F:\Images\GIMP_Autosave\Concordia[720x720]\autosave_1.xcf”: No such file or directory

 GIMP Error
Execution error for 'Activate':
Error: Procedure execution of gimp-xcf-save failed: Error creating 'F:\Images\GIMP_Autosave\Concordia[720x720]\autosave_1.xcf': Error opening file “F:\Images\GIMP_Autosave\Concordia[720x720]\autosave_1.xcf”: No such file or directory

UPDATE: I created the GIMP_Autosave folder manuallly, and the Concordia[720x720] folder manually, and it is now saving the autosave files for the test image in the correct folder on the F: drive! Big Grin

Now.. why won't it create those folders for itself??

UPDATE2: I tested with an unamed image and an alpha-only named image, the issue is definitely that it cannot create folders.

I also note that if one image errors out, it does not autosave any of them, but that may be expected behaviour.
I also noted that I don't HAVE to shut down GIMP to clear the error condition, I can just disable autosave, then enable it again. Smile

Hi,

if you change these two #f to #t in almost-autosave.scm

;; Global Variables
(define debug #f)
(define debug-time #f)

Then you should get more debug output in the error console about what the script is doing, or attempting to do.
It should also attempt to save frequently, helping us to diagnose the issue.

Here in Debian stable, I don't have to create a folder. I point it at a folder that does exits "Location" or leave it blank for Home.
Then the Storage Directory Name, is created automatically in that location.

So I'm as puzzled as you!

This is from my Error Console, after Reset > Factory Reset,  then using Set Up and pointing at a new location on an external drive, storage folder non-existent. It gets to work, creating the folder and making the saves.


> global-aa-set-up : type : boolean : #t
> Parasite not found: global-aa-waiting
> Parasite not found: global-aa-waiting
> global-aa-status : type : boolean : #t
> global-aa-save-every-minutes : type : number : 15
> global-aa-max-saves : type : number : 3
> global-aa-path-set-in-dialog : type : string : /media/mark/DailyBackUp
> global-aa-dir-name : type : string : /test-make-dir
> autosave-settings: list:
(save-every-minutes . 15)
(max-saves . 3)
(dialog-save-path . /media/mark/DailyBackUp)
(dir-name . /test-make-dir)
> Image is untitled
> dialog-save-path : /media/mark/DailyBackUp
> dir-name : /test-make-dir
> image ID : 7
Path root: /media/mark/DailyBackUp/test-make-dir/Untitled
> dialog-save-path : /media/mark/DailyBackUp
> GUI Save Path: /media/mark/DailyBackUp
> dir-name : /test-make-dir
> GUI Folder   : /test-make-dir
> Autosave path: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Constructing autosave filename: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_1.xcf
> Image base name: Untitled
> Autosave path: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Autosave filename: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_1.xcf
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Initial path parts: list:
media
mark
DailyBackUp
test-make-dir
Untitled_7
""
> Creating directory: /media/mark
> Creating directory: /media/mark/DailyBackUp
> Creating directory: /media/mark/DailyBackUp/test-make-dir
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Saving image to: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_1.xcf
> dialog-save-path : /media/mark/DailyBackUp
> dir-name : /test-make-dir
> image ID : 5
Path root: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp
> dialog-save-path : /media/mark/DailyBackUp
> GUI Save Path: /media/mark/DailyBackUp
> dir-name : /test-make-dir
> GUI Folder   : /test-make-dir
> Autosave path: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Constructing autosave filename: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_1.xcf
> Image base name: RS_26_27_Rough_Comp
> Autosave path: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Autosave filename: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_1.xcf
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Initial path parts: list:
media
mark
DailyBackUp
test-make-dir
RS_26_27_Rough_Comp
""
> Creating directory: /media/mark
> Creating directory: /media/mark/DailyBackUp
> Creating directory: /media/mark/DailyBackUp/test-make-dir
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Saving image to: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_1.xcf
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 0 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 2 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 4 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 6 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 8 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 10 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 12 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 14 seconds
> max-saves : 3
> incremented save index: 2
> global-aa-status : type : boolean : #t
> global-aa-save-every-minutes : type : number : 15
> global-aa-max-saves : type : number : 3
> global-aa-path-set-in-dialog : type : string : /media/mark/DailyBackUp
> global-aa-dir-name : type : string : /test-make-dir
> autosave-settings: list:
(save-every-minutes . 15)
(max-saves . 3)
(dialog-save-path . /media/mark/DailyBackUp)
(dir-name . /test-make-dir)
> Image is untitled
> dialog-save-path : /media/mark/DailyBackUp
> dir-name : /test-make-dir
> image ID : 7
Path root: /media/mark/DailyBackUp/test-make-dir/Untitled
> dialog-save-path : /media/mark/DailyBackUp
> GUI Save Path: /media/mark/DailyBackUp
> dir-name : /test-make-dir
> GUI Folder   : /test-make-dir
> Autosave path: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Constructing autosave filename: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_2.xcf
> Image base name: Untitled
> Autosave path: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Autosave filename: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_2.xcf
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Initial path parts: list:
media
mark
DailyBackUp
test-make-dir
Untitled_7
""
> Creating directory: /media/mark
> Creating directory: /media/mark/DailyBackUp
> Creating directory: /media/mark/DailyBackUp/test-make-dir
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7
> Creating directory: /media/mark/DailyBackUp/test-make-dir/Untitled_7/
> Saving image to: /media/mark/DailyBackUp/test-make-dir/Untitled_7/autosave_2.xcf
> dialog-save-path : /media/mark/DailyBackUp
> dir-name : /test-make-dir
> image ID : 5
Path root: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp
> dialog-save-path : /media/mark/DailyBackUp
> GUI Save Path: /media/mark/DailyBackUp
> dir-name : /test-make-dir
> GUI Folder   : /test-make-dir
> Autosave path: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Constructing autosave filename: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_2.xcf
> Image base name: RS_26_27_Rough_Comp
> Autosave path: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Autosave filename: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_2.xcf
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Initial path parts: list:
media
mark
DailyBackUp
test-make-dir
RS_26_27_Rough_Comp
""
> Creating directory: /media/mark
> Creating directory: /media/mark/DailyBackUp
> Creating directory: /media/mark/DailyBackUp/test-make-dir
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp
> Creating directory: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/
> Saving image to: /media/mark/DailyBackUp/test-make-dir/RS_26_27_Rough_Comp/autosave_2.xcf
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 0 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 2 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 4 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 6 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 8 seconds
> global-aa-status : type : boolean : #t
Checking status... Elapsed time: 10 seconds
> global-aa-status : type : boolean : #t
> Parasite not found: global-aa-status
> max-saves : 3
> incremented save index: 3
> Parasite not found: global-aa-stat


(04-30-2025, 07:10 AM)Ofnuts Wrote:
(04-29-2025, 06:59 PM)crogonint Wrote: UPDATE: I created the GIMP_Autosave folder manuallly, and the Concordia[720x720] folder manually, and it is now saving the autosave files for the test image in the correct folder on the F: drive! Big Grin

Now.. why won't it create those folders for itself??

Because in the code, creating a directory is always a separate action, if only because different user privileges can be necessary. It is usually not a problem because the code usually has some mkdir() function for this.

But it turns out that script-fu is seriously lacking in the file handling department, and so has no mkdir()

It does! (dir-make)

;; Purpose: Makes a directory in the "home" directory with a string "/path/like/this"
(define (make-dir-path path)
 (let* ((pathParts (cdr (strbreakup path DIR-SEPARATOR)))  ; Skip the empty element ?
        (currentPath (string-append "/" (first-item pathParts)))) ; /home
   (debug-message "Initial path parts: " pathParts)
   ;; Create the rest of the directories step-by-step
   (for-each
    (lambda (part)
      (set! currentPath (string-append currentPath "/" part))
      (debug-message "Creating directory: " currentPath)
      (dir-make currentPath))
    (list-remove-head pathParts))))


Working link

https://script-fu.github.io/funky/hub/pl...-Autosave/
Reply


Messages In This Thread
Script-Fu in GIMP 3 website - by pixelmixer - 03-19-2025, 12:37 PM
RE: Script-Fu in GIMP 3 website - by crogonint - 04-21-2025, 02:16 AM
RE: Script-Fu in GIMP 3 website - by pixelmixer - 04-23-2025, 08:39 PM
RE: Script-Fu in GIMP 3 website - by crogonint - 04-21-2025, 01:39 PM
RE: Script-Fu in GIMP 3 website - by pixelmixer - 04-24-2025, 11:48 AM
RE: Script-Fu in GIMP 3 website - by crogonint - 04-29-2025, 06:59 PM
RE: Script-Fu in GIMP 3 website - by Ofnuts - 04-30-2025, 07:10 AM
RE: Script-Fu in GIMP 3 website - by crogonint - 04-30-2025, 05:53 PM
RE: Script-Fu in GIMP 3 website - by pixelmixer - 04-30-2025, 07:09 PM
RE: Script-Fu in GIMP 3 website - by pixelmixer - 05-01-2025, 07:20 AM
RE: Script-Fu in GIMP 3 website - by crogonint - 05-04-2025, 08:33 PM
RE: Script-Fu in GIMP 3 website - by crogonint - 05-06-2025, 11:37 PM
RE: Script-Fu in GIMP 3 website - by crogonint - 05-07-2025, 12:41 AM
RE: Script-Fu in GIMP 3 website - by pixelmixer - 05-08-2025, 10:22 AM

Forum Jump: