
Necromorph
Active Members-
Posts
171 -
Joined
-
Last visited
About Necromorph
- Birthday July 29
Necromorph's Achievements
-
Aghilas reacted to a post in a topic: create text file
-
Send Win+Shift+Left or Right arrow
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
ShellExecute("C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MSI\MSI GamingApp\MSI GamingApp") WinWaitActive("MSI Gaming App") Send("#+{LEFT}") Well, I don't know why, but if I compile the script with this code, and then run the .exe as an admin, it works. No flipping idea why, but it works. lol, thanks for the help. -
Send Win+Shift+Left or Right arrow
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
ShellExecute("Calc.exe") WinWaitActive("Calculator") Send("#+{LEFT}") So, it must be something with the application, because this works fine. Thanks again. -
Send Win+Shift+Left or Right arrow
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
I tried that one too. I'm glad to see im not just missing something obvious. thanks for the help, im going to keep working at it. Thanks. -
Send Win+Shift+Left or Right arrow
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
I attempted this first, but it did not work, I will try again, thanks. -
ShellExecute("C:\Program Files (x86)\MSI\MSI GamingApp\MSIGamingApp.exe") Sleep(3000) WinActivate("MSI Gaming App") Send("{LWINDOWN}{SHIFTDOWN}{LEFT}", 1) Send("{LWINUP}{SHIFTUP}", 1) Sorry if this has been asked already, I did search a bit, and didn't find anything helpful. Basically I wanted to open an application, then send it to my secondary monitor with the WindowsKey + Shift + Left arrow, but it just doesn't work, I hope maybe I am just missing something easy. I haven't used AutoIT it a while, but I thought it would be perfect for this type of task. Thanks for any help.
-
well, im not sure the best way to do this, as a service or a shortcut, but for testing, i just need to make it work first, so i tired this #include<File.au3> HotKeySet("^+t", "_NewTextFile") Func _NewTextFile() _FileCreate(@WorkingDir & "\New Text File.txt") EndFunc While 1 Sleep(100) WEnd and i tried putting a msgbox in the "while" statement, but the while statement stays @ScriptDir, im sure im just misusing the @WorkingDir but, as i said, any help would be appreciated.
-
basically, here i need a way to get the current directory that is ACTIVE, i want to create a function/service/shortcut that is similar to the "CTRL+SHIFT+N" that exists in window 7 that makes a new folder, i want to make a new text document, when you "CTRL+SHIFT+T" i cannot get the @WorkingDir to work. any help would be appreciated.
-
FileOpenDialog() to get a directory
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
I have to apologize. I can't belive that i missed that, its perfect. thank you. -
I am making a backup utility, and i want to be able select a "source" directory, is there a way to to do it with the FileOpenDialog() function? $var = FileOpenDialog("title", StringLeft(@SystemDir, 3), '') GUICtrlSetData($hCtrl, $var) when i use this, i have to select a file, or multi select files, i would rather just select a folder.
-
Mousemove method not working in RDP session
Necromorph replied to sachin3079's topic in AutoIt General Help and Support
Try useing the autoit info window and using the WinActivate() function first. -
thanks for the help, and sorry i went so long before i seen it, here is my finished code. for it work right, you need a folder in the @ScriptDir called "needed assemblies" and build your "Constants" or "templates" there. for outlook a signature builds three files, an .htm, .rtf, .txt. so i put what i wanted for everyones there, and just move it to @appdata & "\Microsoft\Signatures\*.*" and my script builds the rest. Here it is. #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=mail_edit.ico #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Run_Tidy=y #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include<AD.au3> #include<File.au3> #include<GUIConstantsEx.au3> #include<GuiRichEdit.au3> ;// Query Active Directory to get the current user's object properties and sets variables _AD_Open() If @error <> 0 Then Exit EndIf $adObj_company = _AD_GetObjectProperties(@UserName, 'company') If $adObj_company[0][0] = 0 Then Exit Else $adObj_company = $adObj_company[1][1] EndIf $adObj_displayName = _AD_GetObjectProperties(@UserName, 'displayName') If $adObj_displayName[0][0] <> 0 Then $adObj_displayName = $adObj_displayName[1][1] $adObj_mail = _AD_GetObjectProperties(@UserName, 'mail') If $adObj_mail[0][0] <> 0 Then $adObj_mail = $adObj_mail[1][1] $adObj_mobile = _AD_GetObjectProperties(@UserName, 'mobile') If $adObj_mobile[0][0] <> 0 Then $adObj_mobile = $adObj_mobile[1][1] $adObj_telephoneNumber = _AD_GetObjectProperties(@UserName, 'telephoneNumber') If $adObj_telephoneNumber[0][0] <> 0 Then $adObj_telephoneNumber = $adObj_telephoneNumber[1][1] $adObj_title = _AD_GetObjectProperties(@UserName, 'title') If $adObj_title[0][0] <> 0 Then $adObj_title = $adObj_title[1][1] _AD_Close() ;// Move signature template files from needed assemblies folder to signatures folder, based on return value of $adObj_company FileCopy(@ScriptDir & '\Needed Assemblies\' & $adObj_company & '\*.*', @AppDataDir & '\Microsoft\Signatures\', 1) ;// Complete '*.txt' file based on fields retuned from active directory $txtObj_file = @AppDataDir & '\Microsoft\Signatures\' & $adObj_company & '_email_signature.txt' _FileWriteToLine($txtObj_file, 2, '') If $adObj_displayName > '' Then _FileWriteToLine($txtObj_file, 2, $adObj_displayName) If $adObj_mobile > '' Then _FileWriteToLine($txtObj_file, 3, $adObj_mobile & " mobile") If $adObj_telephoneNumber > '' Then _FileWriteToLine($txtObj_file, 3, $adObj_telephoneNumber & " direct") If $adObj_mail > '' Then _FileWriteToLine($txtObj_file, 3, $adObj_mail) If $adObj_title > '' Then _FileWriteToLine($txtObj_file, 3, $adObj_title) ;// Complete '*.htm' file based on fields returned from active directory $htmObj_file = @AppDataDir & '\Microsoft\Signatures\' & $adObj_company & '_email_signature.htm' If $adObj_displayName > '' Then _FileWriteToLine($htmObj_file, 2, '<BR/>' & '<strong>' & $adObj_displayName & '</strong>' & '<BR/>') If $adObj_mobile > '' Then _FileWriteToLine($htmObj_file, 3, $adObj_mobile & " mobile" & '<BR/>') If $adObj_telephoneNumber > '' Then _FileWriteToLine($htmObj_file, 3, $adObj_telephoneNumber & " direct" & '<BR/>') If $adObj_mail > '' Then _FileWriteToLine($htmObj_file, 3, '<a href="mailto:' & $adObj_mail & '">' & $adObj_mail & '</a>' & '<BR/>') If $adObj_title > '' Then _FileWriteToLine($htmObj_file, 3, $adObj_title & '<BR/>') ;// Complete '*.rtf' file based on fields returned from active directory $rtfObj_file = @AppDataDir & '\Microsoft\Signatures\' & $adObj_company & '_email_signature.rtf' $frm_main = GUICreate('', 0, 0) $ctrl_edit = _GUICtrlRichEdit_Create($frm_main, '', 0, 0) _GUICtrlRichEdit_StreamFromFile($ctrl_edit, $rtfObj_file) _GUICtrlRichEdit_GotoCharPos($ctrl_edit, 0) _GUICtrlRichEdit_SetCharAttributes($ctrl_edit, '+bo') If $adObj_displayName > '' Then _GUICtrlRichEdit_InsertText($ctrl_edit, $adObj_displayName & @LF) If $adObj_title > '' Then _GUICtrlRichEdit_InsertText($ctrl_edit, $adObj_title & @LF) If $adObj_mail > '' Then _GUICtrlRichEdit_InsertText($ctrl_edit, $adObj_mail & @LF) If $adObj_mobile > '' Then _GUICtrlRichEdit_InsertText($ctrl_edit, $adObj_mobile & " mobile" & @LF) If $adObj_telephoneNumber > '' Then _GUICtrlRichEdit_InsertText($ctrl_edit, $adObj_telephoneNumber & " direct" & @LF) $xPos = _GUICtrlRichEdit_FindTextInRange($ctrl_edit, $adObj_mail) _GUICtrlRichEdit_SetSel($ctrl_edit, $xPos[0], $xPos[1]) _GUICtrlRichEdit_SetCharAttributes($ctrl_edit, "+un") _GUICtrlRichEdit_SetCharAttributes($ctrl_edit, "+li") _GUICtrlRichEdit_SetCharColor($ctrl_edit, "16711680") _GUICtrlRichEdit_GotoCharPos($ctrl_edit, 0) _GUICtrlRichEdit_StreamToFile($ctrl_edit, $rtfObj_file) GUIDelete($frm_main) ;// Create registry key(s) for default send/reply signature, if not exits $regObj_outlookVersion = StringRight(RegRead("HKCR\Outlook.Application\CurVer", ""), 2) & '.0' RegRead("HKCU\Software\Microsoft\Office\" & $regObj_outlookVersion & "\Common\MailSettings", "NewSignature") If @error = -1 Then RegWrite("HKCU\Software\Microsoft\Office\" & $regObj_outlookVersion & "\Common\MailSettings", "NewSignature", "REG_SZ", $adObj_company & "_email_signature") EndIf RegRead("HKCU\Software\Microsoft\Office\" & $regObj_outlookVersion & "\Common\MailSettings", "ReplySignature") If @error = -1 Then RegWrite("HKCU\Software\Microsoft\Office\" & $regObj_outlookVersion & "\Common\MailSettings", "ReplySignature", "REG_SZ", $adObj_company & "_email_signature") EndIf Exit may be it will work for otheres as well. P.S. the files need to be named what ever value is returned from $adObj_company = _AD_GetObjectProperties(). that is why if this returns '' or NULL, it will exit. enjoy.
-
_GUICtrlRichEdit_SetAttributes()
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
if you create an RTF doc and open it in word, and type "ThisIsAnEmail@ADomain.com" then hit enter, it will make it a link. and you don't need the "Mailto:" infront of it. if i use the above sample, it will say "mailto:ThisIsAnEmail@ADomain.com". im try to do this without opening the document, and sending the 'keys' followed by an Send('{ENTER}') or something and with no 'mailto:'. but maybe that is what i will have to do. -
_GUICtrlRichEdit_SetAttributes()
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
this does work, but if try to remove the "mailto:" part, it wrecks it. im telling you, this is impossable. ahah, but i will keep trying. thanks again -
_GUICtrlRichEdit_SetAttributes()
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
Good work, it works with a URL, but the main issue was to use it with an email address, and this doesn't work. But thanks a lot, though you have been most helpfull, i will still try to make this work. -
_GUICtrlRichEdit_SetAttributes()
Necromorph replied to Necromorph's topic in AutoIt General Help and Support
Thanks for the help, it does work in your script, the problem is that im using this technique to actuall edit an exsiting .rtf file. so if you add the _GUICtrlRichEdit_StreamToFile($hRichEdit, $sRTF) [after you use the button to change to link] and push it to a file, it still doesn't retain the "+li" attribute, but if you use "+bo" for bold, that works. im starting to think this isn't possiable #include <GuiConstants.au3> #include <GuiRichEdit.au3> $sRTF = @ScriptDir & "\test.rtf" $sLink = "www.autoitscript.com" $sText = "This is line one." & @CRLF & _ "This is line two." & @CRLF & _ "Line three is the link: <insert link here>" & @CRLF & _ "This is line four." & @CRLF & _ "This is line five." & @CRLF $hGUI = GUICreate('Test1.rtf', 400, 400) $hRichEdit = _GUICtrlRichEdit_Create($hGUI, $sText, 10, 10, 380, 340) $idButton = GUICtrlCreateButton("Create Link", 150, 360, 100, 30) GuiSetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_StreamToFile($hRichEdit, $sRTF) _GUICtrlRichEdit_Destroy($hRichEdit) Exit Case $idButton $aPos = _GUICtrlRichEdit_FindTextInRange($hRichEdit, "<insert link here>") _GUICtrlRichEdit_SetSel($hRichEdit, $aPos[0], $aPos[1]) _GUICtrlRichEdit_ReplaceText($hRichEdit, $sLink) $aPos = _GUICtrlRichEdit_FindTextInRange($hRichEdit, $sLink) _GUICtrlRichEdit_SetSel($hRichEdit, $aPos[0], $aPos[1]) _GUICtrlRichEdit_SetCharAttributes($hRichEdit, "+li") EndSwitch WEnd but thanks again.