Print the name of the current script in the script editor

Print the name of the current script in the script editor

Anonymous
Not applicable
677 Views
2 Replies
Message 1 of 3

Print the name of the current script in the script editor

Anonymous
Not applicable

In the Maya Script Editor is there a way to find the name of the script that's currently selected?

Sounds daft, but if there a lot of tabs open (all called Python) it can get confusing 😉

 

Normally

 

    import os

    print sys.argv[0]

 

would print the name of the script. In the cayse of Maya it just prints

 

    C:\Program Files\Autodesk\Maya2017\bin\maya.exe

 

0 Likes
678 Views
2 Replies
Replies (2)
Message 2 of 3

Roland.Reyer
Autodesk
Autodesk

Hi,

 

In Maya 2018 when you load a script into a tab (or after savinbg it) the tab ist the name of the file.

 

grafik.png

0 Likes
Message 3 of 3

Anonymous
Not applicable

...And for those of use who use Maya 17 (or earlier)?

0 Likes