create a dir w/out prompting the user

A forum dedicated to George scripting questions
Post Reply
mobrien
Posts: 6
Joined: 23 Jun 2020, 01:31

create a dir w/out prompting the user

Post by mobrien »

Hola~

Sorry, I'm new to this world, so this is likely a silly question. I am trying to automate our export process on the farm. I'd like to create a directory:

Code: Select all

tv_writetextfile mkdir '/path/to/dir'
Is there a way to create a directory in george and have it not prompt the user?

Thanks in advance.

MO
User avatar
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: create a dir w/out prompting the user

Post by Hironori Takagi »

The prompt does not occur just by executing the tv_WriteTextFile command.
The folder is automatically created without a response.
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
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: create a dir w/out prompting the user

Post by Svengali »

Are you using TVPaint release 11???
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
Hironori Takagi
Posts: 313
Joined: 14 May 2018, 10:15
Location: Tokyo, Japan
Contact:

Re: create a dir w/out prompting the user

Post by Hironori Takagi »

Yes.

I remember one important thing.
If you execute the file operation script immediately after starting TVPaint, a message asking whether to allow file operation appears.
This happens independently of the script. No dialog will appear after the second time.
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
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: create a dir w/out prompting the user

Post by Svengali »

One thing you can test... In the Edit > Preferences > Interface page, you can check/uncheck the "George Alert:tv_WriteTextFile - box", an option which I think is version 11 only...
Spoiler : :
When disabled (unchecked) you receive this warning:
George Alert Box in Preferences-Interface.png
George Alert Box in Preferences-Interface.png (5.51 KiB) Viewed 3310 times
"If you deactivate this option, you will no longer be warned
when a script will try to modify files on your computer.
Are you sure you want to contiue?
OK Cancel"
I'm not sure if this will affect the creation-of-a-directory-warning or not when unchecked - but you can test it.

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
mobrien
Posts: 6
Joined: 23 Jun 2020, 01:31

Re: create a dir w/out prompting the user

Post by mobrien »

Hola~

Yes, using tv paint 11 pro.

I can't get the Preferences -> Interface -> George Alert: tv_WriteTextFile option to be sticky. ie, once I restart tv paint, that setting seems to reset. Even if that worked, it's not a great solution as I'd like to avoid preference settings on the farm.

Just to say it, this is part of an automated process. I'm not totally sure why tv paint requires the user to sign off on a dialog for creating a directory, but exporting layers to files is fine. ie, it's not any file/dir write, it seems to be just this tv_writetextfile command.

Is there a way to fork out to a shell to run mkdir? I am ultimately trying to run tv_projectsavesequence. Is there a way to get that command to create intermediate directories?
Post Reply