Home Download Buy Blog Forum Support

sublime.get_clipboard() return file path

sublime.get_clipboard() return file path

Postby Binocular222 on Sat Jan 04, 2014 12:41 pm

The API said sublime.get_clipboard() return plain text. However, when I copy a file, that command return blank (should be file path in this case).

So, anyway can I get file path from a copied file object in clipboard?
Posts: 76
Joined: Sat May 18, 2013 4:10 pm

Re: sublime.get_clipboard() return file path

Postby lunixbochs on Wed Jan 08, 2014 3:10 am

This is probably an OS-specific question.

The clipboard implementations on at least Windows and OS X support a data "type", and you can even have multiple different data types on the clipboard at once - e.g. html, plain text, image, file path.

Sublime is probably only requesting the "plain text" data type from your clipboard.

If you're on Windows, you can use the win32 plugin from over here viewtopic.php?f=5&t=15070 for direct clipboard access.

If you're on OS X, you can run AppleScript, Python, or pbcopy/pbpaste in a subprocess to access the clipboard.
Posts: 92
Joined: Fri Oct 08, 2010 10:18 pm

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests