Jump to content

Recommended Posts

Posted

#Include <Constants.au3>
Opt("TrayMenuMode",1)
$Clip = TrayCreateItem("Clip")
TrayCreateItem("")
$Help = TrayCreateItem("Help")
TrayCreateItem("")
$About = TrayCreateItem("About")
TrayCreateItem("")
$Exit  = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = $Clip
            _Clip()
        Case $msg = $Help 
            MsgBox(0,"Help","How do I use this? " & @CRLF & @CRLF & "While let me just say it can't get any more simpler just follow below" & @CRLF & @CRLF & "- copy and paste any text or file you want  " & @CRLF & "- go in your taskbar and right click on clip " & @CRLF & "- now click on clip " & @CRLF & "- now your text or file are in the same place as you put clip")
        Case $msg = $About
            MsgBox(0,"About","-------------------------------------------------" & @CRLF & "Cliper is a simple but useful tool." & @CRLF & "-------------------------------------------------" & @CRLF & " I do not know about you but I use copy and paste everyday." & @CRLF & " I then copy something else and then later on forget something that I pasted for later. " & @CRLF & "While my troubled days are over.")
        Case $msg = $Exit
            ExitLoop
    EndSelect
WEnd

Func _Clip()
    $Get = ClipGet()
    If @error = 1 Then MsgBox(0 , "" , "There is nothing for clip to save...")
    If @error = 2 Then 
        FileWrite("Files.txt" , $Get)
    Else
        FileWrite("Copied Text.txt" , $Get & @CRLF)
        EndIf
    EndFunc

my problem is when I want to save the file it gives me the path I know I could copy the file from the path and paste in the @scriptdir but what if I copy a file from the internet?

Posted

?

Look in the helpfile - INetGet:

InetGet("http://www.mozilla.org", "C:\foo.html")
InetGet("http://www.autoitscript.com", "C:\mydownload.htm", 1)
InetGet("ftp://ftp.mozilla.org/pub/mozilla.org/README", "README.txt", 1)


; Advanced example - downloading in the background
InetGet("http://www.nowhere.com/somelargefile.exe", "test.exe", 1, 1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)
Posted (edited)

?

Look in the helpfile - INetGet:

InetGet("http://www.mozilla.org", "C:\foo.html")
InetGet("http://www.autoitscript.com", "C:\mydownload.htm", 1)
InetGet("ftp://ftp.mozilla.org/pub/mozilla.org/README", "README.txt", 1)
; Advanced example - downloading in the background
InetGet("http://www.nowhere.com/somelargefile.exe", "test.exe", 1, 1)

While @InetGetActive
  TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)
  Sleep(250)
Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)

yes I know about Inetget but the problem is how will I know if a actual file (desktop file) is in the clipboard or a url file

Edited by testingtest
Posted

yes I know about Inetget but the problem is how will I know if a actual file (desktop file) is in the clipboard or a url file

I guess you would check to see if the file exists on the computer in the location given by the user.. if not, assume it is a URL.

and run a regular expression to test the string.

  • 2 months later...
Posted

Hi--

True, I'm a noob--

But I have read the docs and combed this site.

In Microsoft Word, I want to be able to take something that is selected and put it into the clipboard, change to Excel and paste it into a cell, after pstikng, move to thenext lower cell, and then return to Word.

If Microsoft had Applescript, this would be no problem.

The docs for clipput and clipget suggest that one would have to copy the text, not just select it. My carpal tunnel is tired of three fingered congrol codes.

Please advise.

Thanks!

Rick L

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
×
×
  • Create New...