Call a .txt file according to the selected object's name
Hi,
I would like to open a .txt file that has the same name as the selected object. I found some complex debates about scripting to link external data; but before trying to understand all these, I wanted to ask the question directly:
Is there a way to get a script that would open a text file, contained inside the .blend file that has the same name as the selected object (through a shortcut ideally)?
4 Comments
There should be a way: blender.stackexchange.com/questions/19491/how-to-switch-texts-in-text-editor-by-script
pasteall.org/pic/3ed902d226464fd09f520c798556d8fe It would be like a macro that copies the name of the selected object (F2 + Ctrl + C + Enter) selects a list of .txt text editor and pastes the name to find the .txt file that will have been previously saved with the same name (Ctrl + V)
Is: -F2 -Ctrl + C -Enter -Select the list of .txt files from the text editor -Ctrl + V -Enter
pasteall.org/pic/3ed902d226464fd09f520c798556d8fe
It would be like a macro that copies the name of the selected object (F2 + Ctrl + C + Enter) selects a list of .txt text editor and pastes the name to find the .txt file that will have been previously saved with the same name (Ctrl + V)
Is: -F2 -Ctrl + C -Enter -Select the list of .txt files from the text editor -Ctrl + V -Enter
I can easily get the object's name with something like: import bpy.data Name= bpy.context.object.name
but then?
It is a proposal. Why should everything be linkable but not .txt files?
this is not really the place to ask- RCS is about making feature proposals and requests for the core Blender software. If you have a question about how to use Blender, or how to write a script- try one of the many Blender related forums, such as BlenderArtists.org