Jump to content

gcue

Active Members
  • Posts

    2,323
  • Joined

  • Last visited

1 Follower

Profile Information

  • Member Title
    just a wannabe

Recent Profile Visitors

2,813 profile views

gcue's Achievements

  1. my apologies, there was another script running in the background that was catching the COM error. sorry for the delay was out of the country. Thank you!
  2. I am trying to prevent the dialog box from appearing when the windescription error is following message "The specified domain either does not exist or could not be contacted" but it still pops up even if i comment the msgbox line the message box with the same text shows Global $oGlobalCOMErrorHandler = ObjEvent("AutoIt.Error", "_ErrFuncGlobal") Func _ErrFuncGlobal() If StringInStr($oGlobalCOMErrorHandler.windescription, "The specified domain either does not exist or could not be contacted") = 0 Then $error = @ScriptName & " (" & $oGlobalCOMErrorHandler.scriptline & ") : ==> Global COM error handler - COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oGlobalCOMErrorHandler.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oGlobalCOMErrorHandler.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oGlobalCOMErrorHandler.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oGlobalCOMErrorHandler.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oGlobalCOMErrorHandler.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oGlobalCOMErrorHandler.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oGlobalCOMErrorHandler.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oGlobalCOMErrorHandler.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oGlobalCOMErrorHandler.retcode) MsgBox($msg_error, $script_name, "COM ERROR: " & @CRLF & @CRLF & $error) EndIf EndFunc ;==>_ErrFuncGlobal what is going on?
  3. Here is what lead me to resolve the issue: originally I had turned off visibility and alerting $oExcel = _Excel_Open(False, False, False, False, True) after i enabled $oExcel = _Excel_Open(True, True, True, False, True) I was able to see the error excel was providing Hope this can help someone else! Thank you all for your help
  4. thanks for looking into it. i didnt see any info on there which was relating to the issue im seeing. not adding any links or anything just creating a new workbook.
  5. Hi! I am unable to figure out why i cannot create a workbook. cant find any reference to COM extended error code : -2147023170 Any help is GREATLY appreciated! $oExcel = _Excel_Open(False, False, False, False, True) If @error Then MsgBox($msg_error, $script_name, "Unable to create the Excel application object.") Else ConsoleWrite("success excel open extended: " & @extended) ;here i get "success excel open extended: 1" ;so i know excel wasnt running and the COM object is succesfully created EndIf $oWorkBook = _Excel_BookNew($oExcel, Default) If @error Then $ierror = @error $iextended = @extended ;here i get "Unable to create new workbook. (error: 3 extended: -2147023170)" ;3 - Error returned by method Workbooks.Add. @extended is set to the COM error code ;can't find what that COM extended error code means _Excel_Close($oExcel) MsgBox($msg_error, $script_name, "Unable to create new workbook.") EndIf
  6. awesome. let me know if you need any help testing the least i could do - very thankful to you
  7. np at all im already converting via regex (which i think would be faster than _AD_FQDNtoSamAccountName) thought it'd be a cool add since the similar function provides the option. i even tried copilot but it didnt work. this is what copilot suggested $__oAD_Command.CommandText = "<LDAP://" & $sAD_HostServer & "/" & $sGroup & ">;;sAMAccountName;" & $sRange & ";base" that didnt work - got an empty array then it suggested but same issue $__oAD_Command.CommandText = "<LDAP://" & $sAD_HostServer & "/" & $sGroup & ">;;member;" & $sRange & ";base" $__oAD_Command.PropertiesToLoad.Add("sAMAccountName") no worries - not a big issue just thought id check with you - maybe there's extra syntax in the ldap query to specify to already get return value in samaccountname format - which would be the fastest route
  8. _AD_RecursiveGetGroupMembers - already able to get samaccountname returned AD_GetGroupMembers - not able to get samaccountname returned would it be possible to add that option?
  9. Hi water thank you sooo much for this UDF. has been a huge help with my efforts at work!! i noticed _AD_RecursiveGetGroupMembers provides the ability to return SamAccountName as a returned value but _AD_GetGroupMembers does not, any chance to add that? thanks again!
  10. this worked!!! -w "%%header{Dropbox-Api-Result}" thank you both VERY much!! 🕺
  11. love your idea! not getting back the header. curl request: $CURL_EXE = "c:\windows\system32\curl.exe" $METHOD = "-X POST" $API_URL = "https://content.dropboxapi.com/2/files/download" $HEADERS_1 = "Authorization: Bearer " & $token $HEADERS_2 = 'Dropbox-API-Arg: {\"path\":\"' & $iSource_Path & '\"}' $HEADERS_3 = $iTarget_Path  $iPID = Run($sCmdLine, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) here are the different variations i've tried - cant seem to get just the header $sCmdLine = StringFormat('%s %s --header "%s" --header "%s" --output "%s" -D --write-output %header{Dropbox-Api-Result}', $CURL_EXE, $API_URL, $HEADERS_1, $HEADERS_2, $HEADERS_3) $sCmdLine = StringFormat('%s %s --header "%s" --header "%s" --output "%s" -D - --write-output %header{Dropbox-Api-Result}', $CURL_EXE, $API_URL, $HEADERS_1, $HEADERS_2, $HEADERS_3) $sCmdLine = StringFormat('%s %s --header "%s" --header "%s" --output "%s" -D - -w %header{Dropbox-Api-Result}', $CURL_EXE, $API_URL, $HEADERS_1, $HEADERS_2, $HEADERS_3) $sCmdLine = StringFormat('%s %s --header "%s" --header "%s" --output "%s" -w %header{Dropbox-Api-Result}', $CURL_EXE, $API_URL, $HEADERS_1, $HEADERS_2, $HEADERS_3) $sCmdLine = StringFormat('%s %s --header "%s" --header "%s" --output "%s" --write-output %header{Dropbox-Api-Result}', $CURL_EXE, $API_URL, $HEADERS_1, $HEADERS_2, $HEADERS_3) thank you soooo much for your help!!!
  12. using curl - this is the response i am getting from the curl request. i am uploading a file and the content type i am specifying is Content-Type: application/octet-stream i am adding -D - to the curl request to get a response.
  13. this output is similar to the one above but it has a string before the JSON and 2 line breaks. i tried to use the regex above to account for the string.. but not sure how to account for 2 line breaks? $raw_output = 'HTTP/1.1 200 OK' & @LF $raw_output &= 'Content-Type: application/json' & @LF $raw_output &= 'Cache-Control: no-cache' & @LF $raw_output &= 'X-Content-Type-Options: nosniff' & @LF $raw_output &= 'X-Server-Response-Time: 1010' & @LF $raw_output &= 'Date: Wed, 05 Feb 2025 15:27:50 GMT' & @LF $raw_output &= 'Server: envoy' & @LF $raw_output &= 'Content-Length: 431' & @LF $raw_output &= 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' & @LF $raw_output &= 'X-Robots-Tag: noindex, nofollow, noimageindex' & @LF $raw_output &= 'Vary: Accept-Encoding' & @LF $raw_output &= 'X-Dropbox-Response-Origin: far_remote' & @LF $raw_output &= 'X-Dropbox-Request-Id: c34ba46094f64fcda2752ad7c9a02b0f' & @LF $raw_output &= '' & @LF $raw_output &= '{"name": "PTT-20240620-WA0002.opus", "path_lower": "/camera uploads/ptt-20240620-wa0002.opus", "path_display": "/Camera Uploads/PTT-20240620-WA0002.opus", "id": "id:Bl5VOgKPuG8AAAAAAAH6MA", "client_modified": "2025-02-05T15:27:50Z", "server_modified": "2025-02-05T15:27:50Z", "rev": "62d66c4b79f0f0c7a269a", "size": 26860, "is_downloadable": true, "content_hash": "08a0d743e12e34868685c8864dd500ae21c74c27ae49f1d43cb64d843e08f711"}' & @LF $aResult = StringRegExp($raw_output, "(?m)^X-Dropbox-Request-Id: [0-9A-Za-z]+(.*)", $STR_REGEXPARRAYMATCH) If @error Then Switch @error Case 1 ;No match found ;~ Return MsgBox($MB_ICONWARNING, "Warning", "No match found.") Case 2 ;Bad regex pattern Exit MsgBox($MB_ICONERROR, "Error", "Bad regex pattern. @extended = " & @extended) EndSwitch EndIf _ArrayDisplay($aResult) $sJson = $aResult[0]
  14. works great!!!! thank you very much!!
  15. the "Dropbox-Api-Result" field (7th line in the output below) contains a result formatted in JSON. trying to separate it out to read values from it $raw_output = 'HTTP/1.1 200 OK' & @LF $raw_output &= 'Content-Type: application/octet-stream' & @LF $raw_output &= 'Accept-Ranges: bytes' & @LF $raw_output &= 'Cache-Control: no-cache' & @LF $raw_output &= 'Content-Disposition: attachment; filename=unspecified' & @LF $raw_output &= 'Content-Security-Policy: sandbox' & @LF $raw_output &= 'Dropbox-Api-Result: {"name": "2025-02-03 08.03.49.jpg", "path_lower": "/camera uploads/2025-02-03 08.03.49.jpg", "path_display": "/Camera Uploads/2025-02-03 08.03.49.jpg", "id": "id:T45AAw", "client_modified": "2025-02-03T16:03:49Z", "server_modified": "2025-02-03T16:50:32Z", "rev": "62d3fb0cc7a260a", "size": 2296979, "media_info": {".tag": "metadata", "metadata": {".tag": "photo", "dimensions": {"height": 2268, "width": 4032}, "time_taken": "2025-02-03T16:03:49Z"}}, "is_downloadable": true, "content_hash": "2c2b30a6447b5a37301e533fg82269db1b06"}' & @LF $raw_output &= 'Etag: W/"62d3fb0dc20c7a26"' & @LF $raw_output &= 'Original-Content-Length: 22969' & @LF $raw_output &= 'Vary: Dropbox-API-Arg, Authorization' & @LF $raw_output &= 'X-Content-Security-Policy: sandbox' & @LF $raw_output &= 'X-Content-Type-Options: nosniff' & @LF $raw_output &= 'X-Server-Response-Time: 1357' & @LF $raw_output &= 'X-Webkit-Csp: sandbox' & @LF $raw_output &= 'Date: Tue, 04 Feb 2025 19:02:02 GMT' & @LF $raw_output &= 'Server: envoy' & @LF $raw_output &= 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' & @LF $raw_output &= 'X-Robots-Tag: noindex, nofollow, noimageindex' & @LF $raw_output &= 'Content-Length: 2296979' & @LF $raw_output &= 'X-Dropbox-Response-Origin: far_remote' & @LF $raw_output &= 'X-Dropbox-Request-Id: 839cba708b480815072cca784' & @LF $json = StringRegExpReplace($raw_output, "Dropbox-Api-Result: {([^,]*)}", "") thanks in advance!
×
×
  • Create New...