[wingide-users] Filenames to clipboard

Jonathan March JDM at MarchRay.net
Sat Sep 17 04:45:42 MDT 2011


On Fri, Sep 16, 2011 at 4:23 PM, Mitchell L Model <dev at software-concepts.org
> wrote:

> >
> > Wing 4.0.4 will have a command copy-filename-to-clipboard.  Here is the
> > implementation which can be dropped into a script in earlier versions of
> > Wing:
> >
> > import wingapi
> > def copy_filename_to_clipboard(fn=wingapi.kArgFilename):
> >  if fn:
> >    wingapi.gApplication.SetClipboard(fn[0])
> >
>
> Here's another version, which I think I've posted before:
>
> def file_paths_to_clipboard():
>   wingapi.gApplication.fSingletons.fGuiMgr.fClipboard\
>       .set_text('\n'.join(wingapi.gApplication.GetCurrentFiles()))
> file_paths_to_clipboard.contexts = [wingapi.kContextProject(),
> wingapi.kContextEditor(),]
>
> This adds it to the contextual menu of editors and the project tool. In an
> editor, it will give you the full path to the file in the editor. In the
> project tool, it will give you the full paths of all selected files.
>
> These seem like useful improvements. Any reason not to include these in the
standard included command?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/wingide-users/attachments/20110917/21f904ee/attachment.html


More information about the wingide-users mailing list