![]() |
| |||||||
Automation Anywhere Post messages and questions related to Automation Software here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
|
My macro is designed to start when any file is added to folder x. My problem is that my macro needs to open the newly added file. The name will be different every time but it usually labeled in the format NDxxxxxx-xx-xxx (where x's are numbers). I can't figure this out...Is the file name a variable? If it is how do I make that work? By opening the file in it's application, I can gather the numbers that I need and save them in a notebook format through my macro. Right now my macro is just opening the same file every time. I thought I might do it through windows explorer by sorting by the newest files in the folder by when they were created but it seems kind of sketchy. It seems like this would be a common problem. I saw the thread by TheBrain but he doesn't say how he opens his file, only how it is triggered by creating a new file. Thanks, spope |
| |||
|
Hello, To trigger a task when a file, say a text file is created in a particular folder and to open that text file that is created, do as follows: * Create 3 folders, say temp, temp_2 and final. * Set the trigger on Temp folder i.e to run a task when new file is created in this folder. Keep this folder empty. * Now, to open the newly created file what you can do is use 'Copy file(s)' command and copy c:\temp\*.txt to c:\temp_2 * Before copying file from temp to temp_2 empty the folder by using 'Delete File(s)' command and delete c:\temp_2\*.txt * Copy c:\temp\*.txt to c:\final . The final folder will contain all the files created in temp folder(which will be emptied after file is created) * Use 'Delete File(s)' command and delete c:\temp\*.txt after file is copied to temp_2 and final folders * Now, rename the file in temp_2 folder. This is because we have to open the file and we need to know its name, so rename c:\temp_2\*.txt to test.txt (for e.g) * Using 'Open Program\files' command open c:\temp_2\test.txt This way you can open the newly created file in a particular folder. All the files created will be copied to Final folder. The task would look something like as follows: 1 Delete Files "c:\temp_2\*.txt" 2 Copy Files "c:\temp\*.txt" to "C:\temp_2" 3 Copy Files "c:\temp\*.txt" to "C:\Final\" 4 Delete Files "c:\temp\*.txt" 5 Rename Files "c:\temp_2\*.txt" to "Test.txt" 6 Open "c:\temp_2\test.txt " Please find the attached zip file including the sample task file(.atmn) |
![]() |
| Thread Tools | |
| Display Modes | |
| |