Yesterday, 04:57 AM
Below is a script to print the results of calling the three procedures Scallact listed in post #2.
It shows that in scheme gimp turns the returned GFile into a string.
Example of the script's printouts:
gimp-image-get-file: Is a string: /tmp/test-filenames.xcf
gimp-image-get-name: Is a string: test-filenames.xcf
gimp-image-get-xcf-file: Is a string: /tmp/test-filenames.xcf
It shows that in scheme gimp turns the returned GFile into a string.
Example of the script's printouts:
gimp-image-get-file: Is a string: /tmp/test-filenames.xcf
gimp-image-get-name: Is a string: test-filenames.xcf
gimp-image-get-xcf-file: Is a string: /tmp/test-filenames.xcf
Code:
#!/usr/bin/env gimp-script-fu-interpreter-3.0
(define (print-info procedure-name value)
(display procedure-name)
(display ": ")
(cond
((not (string? value)) (display "Is not a string: "))
((string=? value "") (display "Is an empty string."))
(else (display "Is a string: "))
)
(display value)
(newline)
)
(define (script-fu-test-filename-v3 image drawables)
(script-fu-use-v3)
(let ((file (gimp-image-get-file image))
(name (gimp-image-get-name image))
(xcf-file (gimp-image-get-xcf-file image)))
(print-info "gimp-image-get-file" file)
(print-info "gimp-image-get-name" name)
(print-info "gimp-image-get-xcf-file" xcf-file)
)
)
(script-fu-register-filter "script-fu-test-filename-v3"
"Test Filename v3"
"Print out some filename tests."
"teapot"
"teapot"
"2025"
"*"
SF-ONE-OR-MORE-DRAWABLE
)
(script-fu-menu-register "script-fu-test-filename-v3" "<Image>/Image")
