George Command to tell which OS is being used?

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

George Command to tell which OS is being used?

Post by Svengali »

Is there a way to have a George script know if TVPaint is running under Windows or Mac or Linux or Android?

The work around I came up with is to search for the back slash in the "home" file path string but it would be much better to just have a command to get the OS info directly.

Code: Select all

tv_GetPath "home"							// default User path
FilePath = result
Slash = CHAR(FilePath,3)							// retrieve 3rd character in FilePath string
IF CMP(Slash,"\")
	FolderName = "\QuickSaveImages\"				// windows
ELSE
	FolderName = "/QuickSaveImages/"				// MAC or Linux
	Slash = "/"
END
ImagePath = FilePath""FolderName
Not sure what separator Android expects???

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
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: George Command to tell which OS is being used?

Post by Mads Juul »

tv_version ["ComputerOS"|"ComputerName"|"UserName"|"ComputerLanguage"]
http://wiki.tvpaint.fr/index.php?title=Tv_Version

-Mads
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: George Command to tell which OS is being used?

Post by Svengali »

Thanks!
I get WIN64. I wonder what other results might be returned?

If anyone might want to test this on their own system (mac or linux) you can create a button using the following in an Embedded George Script:

Code: Select all

tv_Version  "ComputerOS"
OS = result
tv_warn "operating system = " OS
This will report which OS you are using... If anyone tries this could you post the results for mac or Linux here?

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
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: George Command to tell which OS is being used?

Post by Mads Juul »

I think it resturns WIN32 if you use the 32 bit version even on a 64 bit windows
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
User avatar
ematecki
Site Admin
Posts: 2258
Joined: 15 Feb 2006, 14:32

Re: George Command to tell which OS is being used?

Post by ematecki »

Svengali wrote:Not sure what separator Android expects???
Android is Linux based, so it's a '/'.
Anyway, every OS still in existence accept '/', even if it isn't their native separator.
Quicktime is DEAD. Get over it and move on !
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: George Command to tell which OS is being used?

Post by Svengali »

ematecki wrote:
Svengali wrote:Not sure what separator Android expects???
Android is Linux based, so it's a '/'.
Anyway, every OS still in existence accept '/', even if it isn't their native separator.
Thanks.

I guess my actual question was what is the Result returned for Mac and Linux (and Android) since windows returns WIN64 or WIN32?

My next question would be:
Since "computerOS" is a new argument of tv_Version command in George for TVPaint 10, would it be safe and dependable to use the work-around test I posted in the original code window in this thread - looking for a "\" as the third character in the "home" path Result - with both TVPaint 10 AND earlier TVPaint releases? That way I can make George paths that work with all operating systems on any version of TVPaint.

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
ematecki
Site Admin
Posts: 2258
Joined: 15 Feb 2006, 14:32

Re: George Command to tell which OS is being used?

Post by ematecki »

Svengali wrote:
ematecki wrote:
Svengali wrote:Not sure what separator Android expects???
Android is Linux based, so it's a '/'.
Anyway, every OS still in existence accept '/', even if it isn't their native separator.
Thanks.

I guess my actual question was what is the Result returned for Mac and Linux (and Android) since windows returns WIN64 or WIN32?
Well, you talked about a 'separator' :)
Svengali wrote: My next question would be:
Since "computerOS" is a new argument of tv_Version command in George for TVPaint 10, would it be safe and dependable to use the work-around test I posted in the original code window in this thread - looking for a "\" as the third character in the "home" path Result - with both TVPaint 10 AND earlier TVPaint releases? That way I can make George paths that work with all operating systems on any version of TVPaint.
Sven
ComputerOS returns one of :
MACOSX32, MACOSX64, LINUX32, LINUX64, ANDROID, WIN32 or WIN64
32 or 64 refers to TVPaints version, not the OS.

Your workaround _should_ work...
Quicktime is DEAD. Get over it and move on !
Svengali
Posts: 1553
Joined: 28 Dec 2006, 10:08

Re: George Command to tell which OS is being used?

Post by Svengali »

ematecki wrote: Well, you talked about a 'separator' :)
True enough! 8)
ematecki wrote:
Svengali wrote: My next question would be:
Since "computerOS" is a new argument of tv_Version command in George for TVPaint 10, would it be safe and dependable to use the work-around test I posted in the original code window in this thread - looking for a "\" as the third character in the "home" path Result - with both TVPaint 10 AND earlier TVPaint releases? That way I can make George paths that work with all operating systems on any version of TVPaint.
Sven
ComputerOS returns one of :
MACOSX32, MACOSX64, LINUX32, LINUX64, ANDROID, WIN32 or WIN64
32 or 64 refers to TVPaints version, not the OS.

Your workaround _should_ work...
Good news! Thank you for all this useful info... :D

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