Jump to content

How to know if clipboard contents is


 Share

Recommended Posts

Hello everyone,

 I need a simple code to be able to know if current clipboard content is a string text or a file path (a file has been copied)

I think i must use @error but i can't be able to get any results.

Example:

$clipboard = ClipGet()
if $clipboard <> $last And $clipboard <> "" And @error=0 Then
 ; the clipbord contain a string

Endif

  Please help.

Link to comment
Share on other sites

Hi,

Take a look at the _ClipBoard_EnumFormats function example in the helpfile.

You will see the formats according to the data in the clipboard.

Then, you can use _ClipBoard_IsFormatAvailable.

Br, FireFox.

Link to comment
Share on other sites

I just found a REALLY simple solution:

$clipboard = ClipGet()
$textexists=_ClipBoard_IsFormatAvailable($CF_TEXT)

     if $clipboard <> "" And $textexists="1" Then
     ; There is text in clipboard
      Endif

You people... and i am just a beginner in autoit...

I helped myself!

Edited by 4Ever
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...