3 posts in this topic
cause im too new in the Auto it world i will try it with the your help. hopefully.
I woud like to know how i can handle my Problem.
I have a Excel Data with 362 random numbers.
this numbers are a part of the filepath ...example
as u can see its the first number of the Excel data. After the first 4 numbers it shoud make a "_" than another 5 "_"
This is my first question. How can i handle this to make it Shell execute.
If i am in the path.
the code shoud search for specific PDF Files.
They are named like: 0050569E364B1ED79B900F73E62660EC.pdf
the first 15 letters are always the same
when he found this data he has to copy it on a Folder on the Desktop.
(There can also be 2 or 3 pdfs in one Folder with this letters)
Please give me some help :-)
as you know im on a very low autoit-level.
My question is: How can i read all PDFs from a Folder wich is open and copy them to a Folder on a Desktop.
The Folder wich contains the PDFs is variable Z:\Projektls\"*"*"*EVERYTIME ANOTHER ENDING"*"*"*"*"
There can be 1 PDF or even 15 PDFs.
i tried it with _FileListToArray and _FileCopy but i Need some help to understand this language
Here's a short UDF that will, at least in most cases, detect whether a window can be copied from or pasted to programmatically--for example, by Send()ing ctl-c, ctl-v. This is often disabled when programs (like your AutoIt script) run at a lower UAC integrity level than the application they are trying to operate on.
#include <WinAPI.au3> Func _WindowIsPasteable($handle) ;accepts window handle; returns true or false whether a window will accept Ctl-C, Ctl-V Local $bCanPaste = True Local $hTestWindowPID = 0 Local $hTestWindowTID = _WinAPI_GetWindowThreadProcessId($handle, $hTestWindowPID) _WinAPI_AttachThreadInput(_WinAPI_GetCurrentThreadId(), $hTestWindowTID, True);attach to window we want to paste into $bCanPaste = _WinAPI_GetFocus() ;Test whether window is paste-able--returns False if it is not _WinAPI_AttachThreadInput(_WinAPI_GetCurrentThreadId, $hTestWindowTID, False);detach from window thread Return $bCanPaste EndFunc Pass it a window handle; it returns true or false whether a window will accept programmatic pasting. The function may not work on the CMD window, since it handles the clipboard uniquely.
This function works by attaching to the program thread of the window whose handle it receives, then attempting to perform a GetFocus on that thread. In most cases, the attempt will fail if the window will not accept programmatic copy-paste.
May I know how to copy the first 10 characters in excel and paste it in the file explorer textbox? How to do? I know that you show use the StringLeft() function but I am not sure how to do. Please help me. Thank you!
I can easily find my modem comport number using the code below:-
#include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000") Local $iError = 0 If @error Then ; The server is probably offline/port is not opened on the server. $iError = @error MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError) Else MsgBox($MB_ SYSTEMMODAL, "MODEM:", $key) EndIf
but the thing is I am planning to design a small tool by which it can read the modem COM port and set the COM number and send AT command to modem port using UDF CommMG.au3 created by Martin. I added some below code to martins file :-
;====================================================================================================================== ;CommSendStandard,a new function for sending information to a serial port. ;====================================================================================================================== Func _CommSendStandard($port,$error,$command) _CommSetPort($port,$error,9600,8,0,1,2) if $error <> '' Then MsgBox(262144,'Port Error = ',$error) EndIf _CommSendString($command & @CR) EndFunc ;==>_CommGetLineStates ;=============================================================================================== After adding I wrote the below code for sending AT command to modem port but its not working.
Please check the below code and let me know for the issue.
;===================================================================================== #include "C:\Program Files (x86)\AutoIt3\SciTE\CommMG.au3" #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Global $key = RegRead("HKLM\HARDWARE\DEVICEMAP\SERIALCOMM","\Device\ssudmdm0000") Local $iError = 0 If @error Then ; The server is probably offline/port is not opened on the server. $iError = @error MsgBox(BitOR($MB_SYSTEMMODAL, $MB_ICONHAND), "", "Client:" & @CRLF & "Could not connect, Error code: " & $iError) Else MsgBox($MB_SYSTEMMODAL, "MODEM:", $key) EndIf Local $port=$key Local $porterror _CommSendStandard($port,$portError,"AT+CFUN=1,1") ;================================================================================================ but If I set the port number by my own in the code (for eg :- port number 8 or any value instead of $key) it works fine and the modem gets reset.I want to know if there is any way to get the port number to a variable $port and discarding so that my above code works fine...In that case user donot have to take care of entering the port manually everytime and the script will automatically read the port number and set itself.