GeneralDisarray Posted February 9, 2012 Share Posted February 9, 2012 Gentlemen and possibly ladies, I am new to the AutoIt world and trying to get my feet wet. Basically Im creating a script to access a shared folder on the server, copy it, paste to the users desktop, overwrite the previous version, run it in Filemaker, help Filemaker convert it from Version 3 to 9. I dont know much and have pretty much just been using the keyboard and shortcuts to do so. It is basically a lot of sleeps and single/combo button hits. My main question would be, once I open the folder at the server location or the desktop, how do I close it after the file has been copied/pasted? Does Send() use a PID that I can use to close it with ProcessClose()? Here's the poo-tastic code, feel free to poke fun and guide to a smoother way to do it. If not, Ill settle for a list of commands that allow me to use the mouse in this process to phase out all the tabs and Enters. Local $answer = MsgBox(4, "Rob First Crack at it", "This script will open the guardian folder, copy and paste the job catalog. Run?") If $answer = 7 Then MsgBox(0, "Guess its not for you. :(", "OK. Bye!") Exit EndIf Send("#r") Sleep(200) Send("\\server\Sales\Shared\") ;;Location of the server folder that the file resides in Sleep(600) Send("{ENTER}") Sleep(400) Send("b") ;;The letter "b" here was used because the top folder in the "Shared" folder starts with "b", thus giving me a common starting point to go from Sleep(400) Send("{DOWN 10}") ;;The file that I am accessing is 10 files below the top one, thus down arrowing to the one I want Sleep(300) Send("^c") Sleep(300) Send("#r") Sleep(300) Send("C:\Users\PCuser\Desktop") ;;Location of the Users Desktop, only real way I knew how to access it to copy to Sleep(300) Send("{ENTER}") Sleep(400) Send("^v") Sleep(1000) Send("{UP 3}") ;;On Windows 7, a copy and replace window appears if the file already exists in that location. Hitting the up arrow 3 times highlights the Copy and replace button. Sleep(250) Send("{ENTER}") Sleep(400) Send("{ENTER}") Sleep(400) And yes I stole the first couple lines from the examples to see how it interacted. I have some basic Java skills from college Java classes so programming and how things are linked arent new to me, just the syntax wording of the new lanuage. Link to comment Share on other sites More sharing options...
BrewManNH Posted February 9, 2012 Share Posted February 9, 2012 What's wrong with FileCopy instead of trying to automate the command line interface? If you know the name of the file, just use that instead of all this down arrow, control-c stuff. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 9, 2012 Author Share Posted February 9, 2012 The reason I didnt use it was because I was unaware of the calling, you have a list of those commands anywhere? That pretty much took care of thy entire code and put it into one line, thanks. Any way to help Filemaker through its processes without simply keyboard interactions, like mouse clicks? Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 9, 2012 Author Share Posted February 9, 2012 I found a function list, and for the other newbies, its here: http://www.autoitscript.com/autoit3/docs/functions.htm Link to comment Share on other sites More sharing options...
BrewManNH Posted February 9, 2012 Share Posted February 9, 2012 If you look in the help file that comes with the download of AutoIt3 you will find a listing of all the functions and commands available. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 9, 2012 Author Share Posted February 9, 2012 Perhaps Im not using the FileOpen function correctly, FileCopy("serverSalesSharedCatalog.fp3", "C:UsersPC_UserDesktop", 1) Sleep(400) FileOpen("C:UsersPC_UserDesktopCatalog.fp3", 1) This doesnt open the file with anything and if I change the insides of FileOpen to just "Catalog.fp3" it just creates a new file named that in my Autoit File location. Any idea? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 9, 2012 Developers Share Posted February 9, 2012 What did you expect to happen when doing a FileOpen() for that file? It does open the file but am I right to assume you want to launch the application associated with the files extension? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 9, 2012 Author Share Posted February 9, 2012 Yes sir, open the file with the extension that is attached to it. Similar to double clicking the file but if there is a function call to do so, I assume there is, then that beats creating a double click scenario. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 9, 2012 Developers Share Posted February 9, 2012 Just do: ShellExecute("the file name") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 9, 2012 Author Share Posted February 9, 2012 What is the function to wait until a dialog box apears, such as a Save As box? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 9, 2012 Developers Share Posted February 9, 2012 (edited) What is the function to wait until a dialog box apears, such as a Save As box?You will have to do a couple of things when you want to be more effective in this forum:- stop asking these generic questions and be much more explicit.- Try to do a little research before asking, because there is no way you can explain to me you can have this question researched yourself first.- Open the helpfile and have a look there.Jos Edited February 9, 2012 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 9, 2012 Moderators Share Posted February 9, 2012 GeneralDisarray,If you keep asking simple questions like this, you will annoy others so much that you will soon get no answers. You need to do some work as well. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page).There are even video tutorials on YouTube if you prefer watching to reading.I know you want to start coding NOW, but a little study will save you a lot of trouble later on, believe me. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 9, 2012 Share Posted February 9, 2012 To answer the original question of the thread though ... what's wrong with WinClose? It doesn't care how you opened it... it just closes the window. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
GeneralDisarray Posted February 10, 2012 Author Share Posted February 10, 2012 Thanks Blue, Yea that would have eased the issue with the initial question. Beginning to understand some more of the initial stuff. Using WinWait instead of timed sleeps, think Im starting to grasp PIDs and handles as they relate to windows and how to retrieve that info. The Help file as requested was very "helpful" but there is a basic theory question I have regarding my still current problem of clicking a checkbox in a non-autoit window. I have a work around for it by using WinMove to 0,0 and MouseMove with MouseClick to manually uncheck the always checked box but am sure there is a different, less archaic way to do it. I assume Im going to need either the PID or handle of the Window in question with the box and then use a function Im not aware of. Ive Googled the poo out of this question and all I get are IE related or doing it with an Autoit created GUI box. Im pretty sure nothing in Win can help and if my thinking is correct all the GUI functions are for created GUIs from Autoit. If thats the case, I have no idea how to go about starting this procedure. Not looking for a handout or code but a gentle nudge in the right direction would help. It is also possible that, in my infinite noob-dom, this may not be attainable for someone in the early stages of learning and with that Im in understanding but if someone could say, "look towards SuperCheckBox function in conjunction with some stuff from the Win functions," I would be in your debt. Thanks again. Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 10, 2012 Share Posted February 10, 2012 (edited) Control handles work. You could try and get the handle of that particular control: ControlGetHandle() and take a look at ControlCommand() (Specifically "IsChecked" and "UnCheck") Edited February 10, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
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