Jump to content

Print Screen - and save the image


kater
 Share

Recommended Posts

Hi Guy's :)

your advice is very important for me about the below code ;)

I have this code for Print Screen and save the image of the screen in C Drive ;)

My question is : we need to modify in the existing code to save the image of the screen with the name of the existing user so how to get the name and save the image with name of the existing user

  • How to can I get the name of the existing user by AutoIt v3 ?
;Gets Screen HackMan
SEND("{PRINTSCREEN}")
Run("mspaint.exe")
WinWaitActive("untitled - Paint")
WinSetState ( "untitled - Paint", "", @SW_MAXIMIZE )
Send("!EP")
Send("P")
WinWaitActive("untitled - Paint")
Send("!FA")
Send("!T")
Send("{DOWN}")
Send("{DOWN}")
Send("{ENTER}")
Send("!N")
$sFileName = @MON & @MDAY & @HOUR & @MIN & @SEC & ".jpg"
Send("c:\user")

Send("{ENTER}")
Send("{TAB 1}")
Send("{ENTER}")

Send("!{F4}")
EXIT

Edited by kater
Link to comment
Share on other sites

Yeah, there's this new library. But it will only work on WinXP.

@username is the macro you needed. Also, I think that saving the sreenshot on the desktop would be more useful. So instead of Send("c:\user") use:

Send(@DesktopDir&"+7"&@username)

-edit-

If you use Send("c:\user") it will send: c.7user (the / key is 7 in my keyboard.)

So use the + to send a shift stroke.

Edited by Nahuel
Link to comment
Share on other sites

Please advice me in this error :)

I tried to change the existing code to save the image in C Drive but there is some errors

so please advice me in the below code

Send("c:\user"&"+7"&@username)

Send("C:\user\" & @Username & "\" & $Filename)

Where $filename is the name of the file to be saved, eg

$Filename = "image17.bmp"

I'm not sure what the email bits are for, and the "+7" is from advice you were given-

If you use Send("c:\user") it will send: c.7user (the / key is 7 in my keyboard.)

So use the + to send a shift stroke.

Maybe he meant

If you use Send("c:\user") it will send: c:7user (the '\' key is shift '7' in my keyboard.)

So use the + to send a shift stroke.

If you send("C:\user") and it sends "C:\user", then don't worry about the "+7" which must be a quirk of Nahuel's PC, I certainly don't have that problem.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If you send("C:\user") and it sends "C:\user", then don't worry about the "+7" which must be a quirk of Nahuel's PC, I certainly don't have that problem.

Oh sorry, I didn't notice my mistake. I don't know what an English keyboard looks like. In my case, if you want to send the ":" character, you have to press shift+ "." (Which I guess applies for every keyboard), otherwise it will send the dot, obviously. As for the "\" character, I was wrong. It was AltGr+"º" (below esc).

Anyway, sorry if I'm causing confusion. But this is how it works for me. If I use "send("C:\user")" it sends "c.ºuser".

kater, why don't you tell us what the error is. It's probably somewhere else.

I checked your script and I'm not sure what some thigs do.

Here's what I did. (It hasn't been tested properly since my Paint is in spanish, but it worked.)

Send("{PRINTSCREEN}")
Run("mspaint.exe")
WinWaitActive("untitled - Paint")
WinSetState ( "untitled - Paint", "", @SW_MAXIMIZE)
Send("^v")  
Send("^s")
WinWaitActive("Save as")
$sFileName = @MON & @MDAY & @HOUR & @MIN & @SEC & "-"&@Username&".bmp"
ClipPut(@DesktopDir&"\"&$sFileName)
send("^v")
Send("{ENTER}")
Sleep(500);Just in case...
ProcessClose("mspaint.exe")
Link to comment
Share on other sites

I have idea !! :)

No need to all the codes we need to create a new code as the below description

" we need to this point only "

when the script running we need from it to get the user name and copy it in the clipboard

when me want to save the image I'll apply the code of Ctrl +V

with this step can we save the image with same user name ;)

but tell me which code will get the name and it will copy it in the clipboard ? ;)

Link to comment
Share on other sites

Nahuel,

You were so close...

I only had to change

WinWaitActive("Save as") to be

WinWaitActive("Save As")

I'll bet it is hard to do the translation pefect...

I cannot even get English scripts right sometimes and I have an English OS :-)

Thanks for your help in this tread.

-MSP-

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

how to can I get the name of the existing user name and copy it in Clipboard

is there any guy can help me and explain to me :)

1º. Open SciTe (The script editor).

2º. Type this: ClipPut(@UserName)

3º. Save it.

4º. Run the script.

Now the name of the existing user name is in the clipboard.

Just remember to always check the help file. (Look for ClipPut and ClipGet) ;)

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...