[wingide-users] Getting path to a file in a project window

Mitchell L Model MLMConsulting at Comcast.net
Tue Dec 29 08:04:30 MST 2009


I had asked support about the following:

	I would like to be able to click something -- probably right-button  
menu --
	and select and command that places the path to the clicked file (in  
the Project Manager)
	to the clipboard. I can't find anyplace in the GUI that contains that  
information, though I
	assume I could get it by scripting. (Although even then, it might be  
tricky -- it isn't the current
	window's file I want, it's a file I select from the Project Manager  
that might not even be open.)

and got back information about writing an extension and putting it on  
the menu. Here is what I have.
It adds a "File paths to clipboard" to the project menu; selecting it  
inserts the full path to each of the
files currently selected in the Project pane, one to a line. (I don't  
know how to get the menu command
to be title cased.) Thanks Stephan!

def file_paths_to_clipboard():
     names = wingapi.gApplication.GetCurrentFiles()
      
wingapi 
.gApplication.fSingletons.fGuiMgr.fClipboard.set_text('\n'.join(names))

file_paths_to_clipboard.contexts = [wingapi.kContextProject()]



More information about the wingide-users mailing list