kater Posted August 26, 2007 Posted August 26, 2007 (edited) 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 August 26, 2007 by kater
qazwsx Posted August 27, 2007 Posted August 27, 2007 there are easier ways to save the image from print screen than using paint, but i guess paint would be good practice coding.
Nahuel Posted August 27, 2007 Posted August 27, 2007 (edited) 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 August 27, 2007 by Nahuel
kater Posted August 27, 2007 Author Posted August 27, 2007 Please advice me in this error I tried to change the existing code to save the image in C Drive but there is some errorsso please advice me in the below codeSend("c:\user"&"+7"&@username)
martin Posted August 27, 2007 Posted August 27, 2007 Please advice me in this error I tried to change the existing code to save the image in C Drive but there is some errorsso please advice me in the below codeSend("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 meantIf 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.
kater Posted August 27, 2007 Author Posted August 27, 2007 still there is error , How to can I fix it ?
Nahuel Posted August 27, 2007 Posted August 27, 2007 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")
kater Posted August 27, 2007 Author Posted August 27, 2007 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 clipboardwhen me want to save the image I'll apply the code of Ctrl +Vwith 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 ?
kater Posted August 28, 2007 Author Posted August 28, 2007 How to can I get the user name of the existing user ?
herewasplato Posted August 28, 2007 Posted August 28, 2007 How to can I get the user name of the existing user ? @UserName [size="1"][font="Arial"].[u].[/u][/font][/size]
herewasplato Posted August 28, 2007 Posted August 28, 2007 .....but tell me which code will get the name and it will copy it in the clipboard ? ClipPut(@UserName) [size="1"][font="Arial"].[u].[/u][/font][/size]
herewasplato Posted August 28, 2007 Posted August 28, 2007 Nahuel,You were so close...I only had to changeWinWaitActive("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]
herewasplato Posted August 28, 2007 Posted August 28, 2007 ...I'm not sure what the email bits are for,...Let's hope that the screen shots are not to be e-mailed :-( [size="1"][font="Arial"].[u].[/u][/font][/size]
kater Posted August 29, 2007 Author Posted August 29, 2007 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
Nahuel Posted August 29, 2007 Posted August 29, 2007 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now