describing file path in George Topic is solved

A forum dedicated to George scripting questions
Post Reply
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

describing file path in George

Post by Hironori Takagi »

I usually post to the Japanese User Forum, but since there are few script developers, I will post here.

A list of George commands is available from Development, published below.
TVPaint11 Documentation "Instructions and Commands"
https://www.tvpaint.com/doc/tvpaint-ani ... e-commands

In the description in "tv_stackload iFile" and "tv_stacksave iFile"

For path with spaces, you need to write:
(to manage the path as a single string inside TVPaint Animation)
tv _ ****** ... '"'" 'c: / Users / Mike / Desktop / my file with spaces.ext "' '' ... ...
The path (already encapsulated with quote (") is again encapsulated with: simple-quote (') quote (") simple-quote (')

As stated above, in line with this rule
tv_stackload '"' binpath '"'
tv_stacksave '"' binpath '"'
As a result of the above description, we confirmed a case that did not work.

When creating a script, I always want to take into account that the file path uses the "%20" (space key) character path.
But, depending on the type of command, is it better not to use a quotation statement?

The attached George is a script to perform the operation of keying white at a time and solves the above problem,
but the quotations insert in tv_WriteTextFile line and remove in tv_StackLoad and tv_StackSave line.

I'm sorry in poor English.
Thank you for reading.
Attachments
WhiteKey_190607.grg
(3.95 KiB) Downloaded 432 times
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: describing file path in George

Post by Hironori Takagi »

I didn't write the results of this script here.
The description of the tv_StackLoad and tv_StackSave paths is no longer written using (') (") (').
And always include at using tv_WriteTextFile.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: describing file path in George

Post by NathanOtano »

Nice thanks :) I was wondering also about his
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: describing file path in George

Post by NathanOtano »

Following on this, i'm stuck with writing text files/xml files containing either spaces or simple quotes (') which can be contained in some xml lines

A once and for all description of how to handle this would be greatly appreciated :(
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Xavier
Posts: 1852
Joined: 01 Oct 2019, 11:08

Re: describing file path in George

Post by Xavier »

NathanOtano wrote: 06 Aug 2021, 16:11 I'm stuck with writing text files/xml files containing either spaces or simple quotes (') which can be contained in some xml lines

A once and for all description of how to handle this would be greatly appreciated :(
tv_stackload and tv_stacksave expect a file path as only parameter.
Xavier
Posts: 1852
Joined: 01 Oct 2019, 11:08

Re: describing file path in George

Post by Xavier »

oohhh see this post from Sven : viewtopic.php?f=34&t=14443
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: describing file path in George

Post by Hironori Takagi »

I previously wrote a script called ExportXdts that exports the XSHEET data format (XDTS: based on JSON) that has begun to be used in Japan.
However, tv_WriteTextFile command has no way to start a line with double quotes or tabs, so I compromised by exporting unsupported JSON.
While the scripting language is George, this seems difficult to solve. I am looking forward to the transition of the development language.

(There is a problem with this script, and it seems that if the number of instances exceeds about 100, the upper limit of tv_WriteTextFile will be exceeded.)
Attachments
ExportXDTS_210428.grg
(17.53 KiB) Downloaded 429 times
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: describing file path in George

Post by NathanOtano »

I pretty much found my way trying to either stack multiple lines megring variables or messing with multiple diffreent ' and " and found my way. But I still am a bit unsure of what to do and what not
Sven's post is absolutely useful and I think it should be put on the wiki or documentation :)

Regarding your prolem hironori, have you tried using a varible symb="'" so yuo can write symb instead of '? It worked in one case for me
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: describing file path in George

Post by NathanOtano »

Like here is a small function i used to write a line of xml... Worked at the end but was a bit of try and see
Line was supposed to look like that : <item key='P_00140_000.psd20210807134707' />

Code: Select all

FUNCTION OTANO_Bridge_AddMiddle(Path,Filename,Extension)
	BridgeFile=".BridgeSort"
	Path=Path""BridgeFile
	dot="."
	extension=dot""extension
	Filename=Filename""Extension
	QuotedFilename = ''Filename''
	Line = "<item key="
	Symb = "'"
	Line = Line""Symb
	Line = Line""QuotedFilename
	Zeroes="25071993642000'"
	Line = Line""Zeroes
	Last=" />"
	Line = Line""Last
	tv_WriteTextFile "Append" '"'Path'"' Line
END
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
User avatar
Hironori Takagi
Posts: 279
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: describing file path in George

Post by Hironori Takagi »

Thanks for your comment.
Single quotes (') will succeed the way you say.
but, JSON format requires tab and double quotes ("),
and I've confirmed that double quotes can't be written the same way.
TVPaint 11.7.2(Nov 14 2023), Windows11 Pro, HP Spectre x360 Convertible 14-ea0xxx / TVPaint 11.7.1(Dec 22 2022) Mac OS 11.6, Apple MacBookPro M1 2020
User avatar
NathanOtano
Posts: 1187
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: describing file path in George

Post by NathanOtano »

Ok thanks for the precision! Helps a lot
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Post Reply