naru Posted August 20, 2017 Posted August 20, 2017 (edited) $sdata = Clipget() $bothtext = 12 $bothtext = 14 ;some code here if stringlen($sdata) = $bothtext then ;some code here endif ;some code here i tried it but not working Edited August 20, 2017 by Nareshm ClipData was mistakenly written as clipdata instead
water Posted August 20, 2017 Posted August 20, 2017 What does function Clipdata do? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
naru Posted August 20, 2017 Author Posted August 20, 2017 (edited) 24 minutes ago, water said: What does function Clipdata do? if stringlen($sData) = (12 or 14 Digits) then ControlSend(":: Aadhar Number Entry ::", "", "[NAME:txtAadharNumber]", "^v") ControlClick(":: Aadhar Number Entry ::", "", "[NAME:btnNext]") Else MsgBox(48,"ADHAR NUMBER ERROR - E102", "Adhar Card Number Not Copied, Please Copy Adhar Number and Paste into box or enter manually.") WinWait("Members - Biometric Verification/Check Utility") WinActivate("Members - Biometric Verification/Check Utility") sorry @water ClipData was mistakenly written as clipdata instead ;check If copied text 12 or 14 digits Edited August 20, 2017 by Nareshm
Simpel Posted August 20, 2017 Posted August 20, 2017 Hi. I think you should strip 'Digits'. It should look like: If StringLen($sData) = (12 Or 14) Then Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
water Posted August 20, 2017 Posted August 20, 2017 Something like this: if stringlen($sData) = 12 or stringlen($sData) = 14 then ControlSend(":: Aadhar Number Entry ::", "", "[NAME:txtAadharNumber]", "^v") ControlClick(":: Aadhar Number Entry ::", "", "[NAME:btnNext]") Else MsgBox(48,"ADHAR NUMBER ERROR - E102", "Adhar Card Number Not Copied, Please Copy Adhar Number and Paste into box or enter manually.") WinWait("Members - Biometric Verification/Check Utility") WinActivate("Members - Biometric Verification/Check Utility") My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted August 20, 2017 Posted August 20, 2017 1 minute ago, Simpel said: If StringLen($sData) = (12 Or 14) Then Did you test this? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Simpel Posted August 20, 2017 Posted August 20, 2017 Nope. I'm on vacation without AutoIt. You're right. It should be: If StringLen($sData) = 12 Or StringLen($sData) = 14 Then Conrad SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.
naru Posted August 20, 2017 Author Posted August 20, 2017 Thanks @Simpel and @water But If StringLen($sData) = 12 Or StringLen($sData) = 14 Then is not working Some time my adhar card (clipget) format is 123412341234 (is working) and some time 1234 1234 1234 (include space, not working) Please Help
water Posted August 20, 2017 Posted August 20, 2017 Add a MsgBox to your script: MsgBox(0, "Length", StringLen($sData)) If StringLen($sData) = 12 Or StringLen($sData) = 14 Then My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
naru Posted August 20, 2017 Author Posted August 20, 2017 16 minutes ago, water said: Add a MsgBox to your script: MsgBox(0, "Length", StringLen($sData)) If StringLen($sData) = 12 Or StringLen($sData) = 14 Then Thank you very much @water My problem is solved
water Posted August 20, 2017 Posted August 20, 2017 What had caused your problem? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
naru Posted August 20, 2017 Author Posted August 20, 2017 4 minutes ago, water said: What had caused your problem? @water I was copying cell from excel file And the length of excel cell was 16 (14 + 2 was shown in extra) which I found out from your msgbox script
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now