Erlend 0 Posted April 12, 2010 Hello #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") MsgBox(64, "test", "user information is missing") If $getmailNotes = 0 Then Run("..\app1.exe") EndIf how can i get a if statement over to run app1.exe when $getmailnotes returns a blank value. Thanks. Share this post Link to post Share on other sites
99ojo 0 Posted April 12, 2010 Hi, two ways: #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") ;MsgBox(64, "test", "user information is missing") If $getmailNotes = "" Then Run("..\app1.exe") or #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") If @error Then Run("..\app1.exe") For more information see return values for function _AD_GetObjectAttribute in AD.au3 or in _AD_GetObjectAttribute.htm or .au3 ;-)) Stefan Share this post Link to post Share on other sites
Erlend 0 Posted April 12, 2010 This will give the error: Line-1: Error: Variable must be of type "Object". Share this post Link to post Share on other sites
99ojo 0 Posted April 12, 2010 Hi, sorry, we forgot at least an _AD_Open () and _AD_Close (): #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) _ad_open () $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") ;MsgBox(64, "test", "user information is missing") _ad_close () If $getmailNotes = "" Then Run("..\app1.exe") ;-)) Stefan Share this post Link to post Share on other sites
Erlend 0 Posted April 12, 2010 thanks, i had forgot about that... Share this post Link to post Share on other sites
Spiff59 54 Posted April 12, 2010 I'm not familiar with the AD UDF or what can be expected as return values from it's functions, but... I would think you'd want: If $getmailNotes == "" Then Run("..\app1.exe") Unless using the "==" operator, a return of 0 will also equate to an empty string ("") Share this post Link to post Share on other sites