Notifications
Clear all

[Closed] path using getSavePath() problem

I am trying to use this function getSavePath() to get the directory path from user.

it gives me path like this – “C:\user\somefolder”

but when I try to use this folder to save my render it doesnt work, if I explicitly type the path using forward slash like this “C:\user\somefolder” then it works.

so is there any funcion I have to use to filter the path returned by getSavePath() function?

or is there any other function made for this purpose.

I want to get user path and then use it for saving the render.

1 Reply
 MZ1

You can use a function like this to convert backslashes to slashes:

fn BackSlashToSlash Str =
(
	OldChs = #("\\","
","\r","	","\*","\?","\%")
	NewChs = #("/","/n","/r","/t","/*","/?","/%")
	NewStr = ""
	for i=1 to Str.count do
	(
		if (N = finditem OldChs Str[i]) !=0 then NewStr+= NewChs[N] else NewStr+= Str[i]
	)
	NewStr
)