Switch to full style
Ask all general Gimp related questions here
Post a reply

filename help[Solved]

Thu Oct 15, 2020 1:25 am

GIMP Version: 2.10.22
Operating System: Windows
GIMP Experience: Experienced User



of this file name 'C:\Users\Graechan\Documents\customfont\1Sans.xcf' all I want to use as a name is '1Sans.xcf'

I've tried using strbreakup and string-append but I am having difficulty getting things right hoping someone can assist as I'm having a brain fade

Re: filename help

Thu Oct 15, 2020 2:29 am

Graechan wrote:GIMP Version: 2.10.22
Operating System: Windows
GIMP Experience: Experienced User



of this file name 'C:\Users\Graechan\Documents\customfont\1Sans.xcf' all I want to use as a name is '1Sans.xcf'

I've tried using strbreakup and string-append but I am having difficulty getting things right hoping someone can assist as I'm having a brain fade


Ok I could be completely wrong (not understanding your dilemma) but isn't
'C:\Users\Graechan\Documents\customfont\1Sans.xcf' the path to the file? and '1Sans.xcf' the file name?

Re: filename help

Thu Oct 15, 2020 3:15 am

This is how I loaded a file from a directory but when I wanted to name the file with filename it included the path

(set! file-list (cadr (file-glob (string-append inDir "\\*.xcf") 1)))
(set! filename (car file-list))
(set! img (car (gimp-file-load 1 filename filename)))

And I ended up with a layer name of 'C:\Users\Graechan\Documents\customfont\1Sans.xcf'

Re: filename help

Thu Oct 15, 2020 3:40 am

Code:
(car (last (strbreakup filepath DIR-SEPARATOR)))


Where the filepath is "C:\\Users\\Graechan\\Documents\\customfont\\1Sans.xcf" if written explicitly

Kevin

Re: filename help

Thu Oct 15, 2020 9:53 pm

Thank you Paynekj as it turned out I was not even close, I lost my cheat sheet on strings and memory at my age is fickle to say the least

Image
Post a reply