Sublime Forum

Sublime.get_clipboard() return file path

#1

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?

1 Like

(ST3) Pywin32 Plugin Beta: pywin32 support in Sublime
#2

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 (ST3) Pywin32 Plugin Beta: pywin32 support in Sublime 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.

0 Likes