Thanks so much. I'm emailing you my phone number, but right now I think I've reached a workaround.
To capture the folder's name and its full path, and make it a variable, I've decided to start the task anyplace in the window of Windows Explorer, open to the folder in question. Because I think this provides a general solution, I've made the capture process a separate task, to be called from any other macro needing a path-and-foldername.
It uses Alt-D to highlight the path-and-foldername in the address field, and copy it. Then it pastes it to a new page in Notepad, which it saves as VarStore.txt.
Here's the text:
Quote:
1 Keystrokes: [ALT DOWN][TAB][ALT UP] in "Currently Active Window"
2 Keystrokes: [ALT DOWN]d[ALT UP][CTRL DOWN]c[CTRL UP] in "Currently Active Window"
3 Open "Notepad.exe "
4 Keystrokes: folderpathandname=[CTRL DOWN]v[CTRL UP] in "Untitled - Notepad"
5 Delay: (50 ms)
6 Keystrokes: [ALT DOWN]f[ALT UP]a in "Currently Active Window"
7 Keystrokes: c:\VarStore.txt[ENTER] in "Save As"
8 Delay: (50 ms)
9 Keystrokes: y in "Currently Active Window"
10 Delay: (50 ms)
11 Keystrokes: [ALT DOWN]f[ALT UP]x in "Currently Active Window"
|
Some interesting points: when I start the task the focus is on Windows Explorer, but the act of starting the task takes that focus away. By trial and error I discovered that beginning the routine with Alt-Tab put the focus back where it belonged.
I used the FullFolderName task in ClickHere, which inserts a "Click Here." bookmark in every PDF file in a particular directory. It works, though the test files I've used are only a few pages. I tried putting in "Wait for Window" commands but "Adobe Acrobat Professional - [*.pdf]" doesn't work as a Window Name, and I had to fall back on "Currently Active Window", which won't help me wait until a file is fully opened or fully saved. Using a "Wait for X Seconds" command is useless, because some files save instantly and some take ten minutes, depending on their size and how recently they've been saved before.
Here's the text:
Quote:
1 Comment: Run from Windows Explorer, in desired folder.
2 Run Task "C:\My Documents\Automation Anywhere\Automation Anywhere\My Tasks\FolderFullName.atmn" @Repeat : Do Not Repeat @Speed : Turbo Speed
3 Open "C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe "
4 Wait for Window to Open ("Adobe Acrobat Professional") (Wait up to 60 seconds - for Window to Open)
5 Start Loop " Each File in $folderpathandname$"
6 Comment: Please enter your commands to loop. Use $filename$ variable for each file name in the Loop.
7 Keystrokes: [CTRL DOWN]o[CTRL UP] in "Adobe Acrobat Professional"
8 Wait for Window to Open ("Open") (Wait up to 2 seconds - for Window to Open)
9 Keystrokes: $folderpathandname$\$FileName$.pdf in "Open"
10 Keystrokes: [ENTER] in "Open"
11 Keystrokes: [CTRL DOWN]b[CTRL UP][SHIFT DOWN]c[SHIFT UP]lick [SHIFT DOWN]h[SHIFT UP]ere.[TAB][CTRL DOWN]s[CTRL UP] in "Currently Active Window"
12 Keystrokes: [CTRL DOWN]w[CTRL UP] in "Currently Active Window"
13 End Loop
|
I'm attaching the ATMN files if you want to try them. You'll need to have c:\VarStore.txt already in existence, because of the "y" in answer to the overwrite query.
I'm also attaching Originals.atmn, which solves the problem stated at the start of this thread. It was a lot easier than ClickHere.atmn.