tv_ReadTextFile and tv_WriteTextFile paths

A forum dedicated to George scripting questions
Post Reply
Svengali
Posts: 1554
Joined: 28 Dec 2006, 10:08

tv_ReadTextFile and tv_WriteTextFile paths

Post by Svengali »

I'm having trouble with paths returned by these two commands WHEN THERE IS A SPACE IN ONE OR MORE OF THE FOLDER-NAMES ALONG THE PATH. EXAMPLE:

Code: Select all

Tv_GetPath "George"                            // find path to George folder
GeorgePath = result
tv_WriteTextFile "Exists" GeorgePath            // docs say supposed to return the ExistingFolderPath or ""
PathReturned = result
tv_warn PathReturned
The path returned should be something like:
C:\Program Files\TVPaint Developpement\TVPaint Animation 10 Pro(32bits)\george

But all that is returned is:
C:\Program

the result seems to drop everything past the first space in the path's name! This is a problem because there are many spaces just in the default path getting to TVPaint subfolder or to read what is in the George subfolder - which makes it impossible to READ/WRITE TEXT commands to store or retrieve text file contents inside the TVPaint path.

Is this a bug or is there something I'm not understanding?

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
User avatar
Hervé
Site Admin
Posts: 3490
Joined: 08 Feb 2006, 17:00
Location: Metz France
Contact:

Re: tv_ReadTextFile and tv_WriteTextFile paths

Post by Hervé »

try:
tv_WriteTextFile "Exists" '"'GeorgePath'"'
Hervé ADAM, TVPaint Team
Svengali
Posts: 1554
Joined: 28 Dec 2006, 10:08

Re: tv_ReadTextFile and tv_WriteTextFile paths

Post by Svengali »

Hervé wrote:try:
tv_WriteTextFile "Exists" '"'GeorgePath'"'
It works.

'"'GeorgePath'"' enclosing variable with single quote, double quote, single quote (not two double quotes) on each side... :wink:

Perhaps TVPaint Wiki should be updated to indicate this syntax / punctuation?

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
Post Reply