Jump to content
caramen

Send $Value Error

Recommended Posts

caramen

Hello guys.

I have got this script

$iPid = run("Powershell Get-ADUser "&$UserNameReaded&" -Properties * | select -Expand EmailAddress"  , @WindowsDir , @SW_HIDE , 0x2)
$MailUser = ""

 While 1
    $MailUser &= StdoutRead($iPID)
        If @error Then
            ExitLoop
        EndIf
 WEnd
GUICtrlSetData ($Label015, ""&$MailUser)
If $MailUser = "" Then GUICtrlSetData ($Label017 , "N/A"&$MailUser)

Everything is working fine i got correct value

For my account the value is for exemple :

J.Personnal@Enterprise.com

in the $Label017 the value is correct i have still

J.Personnal@Enterprise.com

If i use :

Send (""&$MailUser)

i have now :

J.Personnalnterprise.com

Is there a way to correct this ?

Share this post


Link to post
Share on other sites
Subz

Do you have any Options set i.e. Opt("ExpandVarStrings", 1)?

Share this post


Link to post
Share on other sites
caramen

@Subz Hi and thx for answer I got 0 option set should i try the one you suggested ?

@Danp2 Hi and ty for answer Can you send me the exact Opt ?

Edited by caramen

Share this post


Link to post
Share on other sites
water

To interact with Active Directory I suggest you use my AD UDF. Much faster than to run PowerShell and the results are returned in an array or variable :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

 

@Danp2 I already tryed to find ofc... I am gonna watch again.

@water I am using your UDF also for account password reset and unlocking account. i like how the script work atm so i wont change it. There is about 1500 lines to change if i use UDF.

I use your AD UDF

I also use your Outlook udf but i cant figure out how to make a signature corectly with it. But i dont want to pm you becose it s forbiden.
i also use your Word UDF xD... in the same script.. no probleme with it.. and one like. ;p

Edited by caramen

Share this post


Link to post
Share on other sites
water

Does the OutlookEX example script _OL_SignatureCreate.au3 work for you or do you get errors?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

I tryed 3 opt and it still does not working.

I need the @ :(

Opt("ExpandVarStrings", 1)
Opt ("SendAttachMode", 1)
Opt ("SendCapslockMode", 1)

Share this post


Link to post
Share on other sites
Subz

Remove the Opts and as Danp2 pointed out try using:

Send (""&$MailUser, 1)

Share this post


Link to post
Share on other sites
caramen

@Subz Ahhh ok this is the optional flag .

ok i tryed it and it s still not working. i tryed

Send (""&$MailUser, 0)

Send (""&$MailUser, 1)

The send is still sending the value without the @

Edited by caramen

Share this post


Link to post
Share on other sites
water

Which application do you send $MailUser to?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Subz

@caramen Just tried the script it's extremely slow compared to AD UDF, but it does work and sends to Word fine with @ sign, just one thing to note that you should use StringStripWS($MailUser, 8) as it appears to include @CRLF or @LF in the returned value, I don't think this should have any impact though on the issue you're encountering.

Share this post


Link to post
Share on other sites
water

Why not use the Word UDF?
OutlookEX comes with an example how to create a signature using Word. Please check _OL_MailSignatureCreate.au3


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
caramen

@Subz It is slow only one time at the beginning of the script it s gonna use all the value after that for a long sequence so it s not a problem

Yeah i noticed about the @crlf @lf i use 4 x {BS} and pixel search for exact positionning.

 

@water I already said you i am not able to use the _OL_MailSignatureCreate becose i am not understunding it. nothing about the script. I whould use it if i was able to. But now my entire script is working exept that line with the @ so i whould be happy to get that line working :).

 

What it can be if it work for you ?

what are the prerequisites to send all key normaly ?

 

 

Share this post


Link to post
Share on other sites
water

I've read your post and understand what you are telling me. But I still think it doesn't make sense and is not very reliable to use Send to create a signature.
If you could post a screenshot of a signature you like to create (or send me via PM) I would be happy to give it a try using Outlook and Word.

 

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

We already solved the signature problems via PM :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

  • Similar Content

    • Fortitude
      By Fortitude
      Hello!
      I have made a program, that opens a folder, and then store the path ("C:\programFiles\etc") in a variable.
      Then i need to open the command panel as administrator, and write  in the stored path, and some other text.

      Can i somehow instantly copypaste the text i needed, instead of writing in the command panel with the Send commands?
       
      #RequireAdmin #include <MsgBoxConstants.au3> Global Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Global $sFileSelectFolder = FileSelectFolder($sMessage, "") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Nem választottál ki mappát!") Exit EndIf Global $Tiff_path = $sFileSelectFolder & "\TiffChecker_2_32" FileCopy( "C:\TiffChecker_2_32.exe" , $sFileSelectFolder) $CMD = $Tiff_path & " " & $sFileSelectFolder & " /s/d" Run("C:\WINDOWS\system32\cmd.exe") WinWaitActive("C:\WINDOWS\system32\cmd.exe") Send($CMD) Sleep(1000) Send("{ENTER}") sleep(1000) MsgBox(0,"Press OK", "Press OK to continue") FileCopy("C:\Tiffchecker.txt", $sFileSelectFolder) Also, how do i close the command panel, when the program is finished? (usually its under 1 second, so after the send i just put a Sleep function there)
    • Docfxit
      By Docfxit
      I would like to know if there is a way to make the send cmd send characters when using
      Graphical AutoIt Debugger By Stumpii,
      If Not WinActive("Setup - UltraVNC","Setup is preparing to install") Then WinActivate("Setup - UltraVNC","Setup is preparing to install") WinWaitActive("Setup - UltraVNC","Setup is preparing to install") Send("{ALTDOWN}f{ALTUP}") ;Finish The debugger when using step mode will execute the Send cmd line but the window doesn't receive the input.
      Thanks,
      Docfxit
    • PoojaKrishna
      By PoojaKrishna
      Hi friends,
      I'm trying to send SHIFTDOWN, to keep the Shift key pressed until I close the program or releases the key.
      Send ( "{SHIFTDOWN}") sleep(100) $text = InputBox("Shift key down", "Shift key is down. Type something: ") $ret = Msgbox(0,"", "Press and release shift key manually and select [Ok] to continue") $text = InputBox("Shift key up", "Shift key is released manually, now type something: ") Send ( "{SHIFTDOWN}") sleep(100) $text = InputBox("Shift key down Agin", "Shift key is pressed again, now type something: ") In the above program sequence,
      1. Send SHIFTDOWN from program, Works as we type in the text are in Capital letters
      2. Manually presses and releases the SHIFT button. SHIFT key is released as when we type, text is in small letters only.
      3. Again send SHIFTDOWN from program, but not working. When we type the letters are in small letters.
       
      If we send a SHIFTUP  before  sending the SHIFTDOWN again, then it is working correctly and the text appears in capital letters only. Can any one explain why this happens?
      Send ( "{SHIFTDOWN}") sleep(100) $text = InputBox("Shift key down", "Shift key is down. Type something: ") $ret = Msgbox(0,"", "Press and release shift key and select [Ok] to continue") $text = InputBox("Shift key up", "Shift key is released manually, now type something: ") Send ( "{SHIFTUP}") sleep(100) Send ( "{SHIFTDOWN}") sleep(100) $text = InputBox("Shift key down", "Shift key is pressed, now type something: ")  
      Thank you.
    • TheDcoder
      By TheDcoder
      Hello everyone, long time since I made a post in the H&S sub-forum
      I am working on a project where in a situation I would have to hold down an arrow key and release it in another statement/command, however when I wrote the code it isn't working exactly like I thought it would. Here is an example:
      Send("{UP down}") Sleep(10000) Send("{UP up}") This should hold the up arrow key for 10 seconds before releasing it again, but when I run this code the cursor in SciTE moves up only once
      If I hold the up arrow manually for 10 seconds it "repeats" and the cursor moves up several times until I release the key... Is this a known limitation of Send? Is there any other way I can accomplish this?
      Thanks for all the help and feedback in advance! TD
    • badcoder123
      By badcoder123
      Anyone know how to access the information circled in the photo?
       

×