caramen

Send $Value Error

18 posts in this topic

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



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

Share this post


Link to post
Share on other sites

Send() has an optional parameter (flag). You could try setting it to 1.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

@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
2 hours ago, caramen said:

Can you send me the exact Opt ?

Read the help file. ;-)

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

#7 ·  Posted (edited)

 

@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

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

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

#10 ·  Posted

Remove the Opts and as Danp2 pointed out try using:

Send (""&$MailUser, 1)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

@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

#12 ·  Posted

Which application do you send $MailUser to?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

#13 ·  Posted

@water Word

Share this post


Link to post
Share on other sites

#14 ·  Posted

@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

#15 ·  Posted

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

#16 ·  Posted

@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

#17 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

#18 ·  Posted

We already solved the signature problems via PM :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - 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

    • badcoder123
      By badcoder123
      Anyone know how to access the information circled in the photo?
       

    • AndreyS
      By AndreyS
      Dear developers and creators of the language, please explain to me why when pressing the combination Crtl + Shift + C from the 5th or the 10th time "sticks / sinks" Ctrl or Shift? And then you need to press Ctrl or Shift again to reset their triggering. I only need to use hot keys like in the example!
      The code is a small example. Its essence is that when a user in the editor selects any number and presses a combination, then it increases by 1. 
      Dim $x HotKeySet("+^c","Calc") While 1 Sleep(10000) WEnd Func Calc() Send("^c") Sleep(50) $x=ClipGet()+1 ClipPut($x) Send("^v") EndFunc I thought that in my program some kind of glitch was searching for a reason for a long time. And it turned out that apparently somehow the work of some functions used in the example is not compatible. 
      Tell me, please, what is the problem?
    • ur
      By ur
      If you observe in below code.
      Func _WinWaitActivate($title,$text,$timeout=$time_out) Logging("Waiting for "&$title&":"&$text) $dHandle = WinWait($title,$text,$timeout) if not ($dHandle = 0) then If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) Else Logging("Timeout occured while waiting for the window...") Exit EndIf EndFunc WinActivate("Untitled - Notepad") $p = "Notallowed1!!" Send("{ENTER}{ENTER}{ENTER}{ENTER}"& $p &"{ENTER}create{SPACE}database{SPACE}"& $p &";{ENTER}") In the notepad if you observe, ! is missing in the text got.
       
      Is there way to get that also printed.
    • rawkhopper
      By rawkhopper
      Hello everyone,
      I have a script that is automating a piece of sluggish software.  I want to automate it with a bit of caution and I am not sure the best way to do it.  ControlSend works great most of the time.  If I have it enter 10 into a text box every once in a while it will enter 1 or 11 and then hit enter.
      To overcome this I use MouseClick to select the text I just entered and then see if it matches the string it was supposed to put in before it hits enter.  This seems to work but what I love about ControlSend is there is less room for human interaction messing it up.  
      Yes I could block input but I prefer not to do that (permissions).
      Is there a better way of doing this?  Any Help would be much appreciated.
      Anyway here is the snippet of the script in question:
      Func KVSend () WinActivate ( "Window", "" ) Local $WindowPos = WinGetPos("Window", "") If $kV < 30 Then WinActivate ( "Window", "" ) ControlClick ("Window", "", 1001) ;Click in Accel Voltage box Sleep (100) ControlSend ("Window", "", 1001, $kV) ; \ kV Sleep (100) MouseMove($WindowPos[0]+130,$WindowPos[1]+75,1) MouseClick($MOUSE_CLICK_LEFT) MouseClick($MOUSE_CLICK_LEFT) Send ("^c") Local $clip = ClipGet () If $clip = $kV Then ControlSend ("Window", "", 1001, "{ENTER}") ;Hit ENTER if value is correct Sleep (100) ControlClick ("Window", "", 1518) ;Lens Clear Else Send ("{BACKSPACE}") KVSend() ; If value is incorrect try again EndIf EndIf  
    • spuuunit
      By spuuunit
      This is what I'm trying to do: In Firefox, if you hold down CTRL + C for about 200ms, then press CTRL + T. This is my code:
      While WinActive(" - Mozilla Firefox") If _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Then $timer = TimerInit() While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) $diff = TimerDiff($timer) If $diff > 200 Then Send("^{T}") While _IsPressed("A2", $hDLL) And _IsPressed("43", $hDLL) Sleep(10) WEnd EndIf WEnd EndIf WEnd The problem is that the CTRL key gets stuck down after Send("^{T}"). I found this, but what I understand that happens when I release, and that is not what I want. The "General unstuck method" did nothing.