OnDownload gets stuck
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
OnDownload gets stuck
Here's my latest attempt to save a pdf file on disk. The macro succeeds in showing the pdf file, but then it gets stuck on the next to last step, and the file is not saved on disk.
Furthermore, if I stop the macro and then try to restart it, it then gets stuck on the VERSION step.
I also tried reversing the slant of the slashes in the ONDOWNLOAD step. And I also tried ONDOWNLOAD FOLDER=* FILE=* . No change.
So I still don't know how to save a pdf file on disk.
VERSION BUILD=6100118
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=watidesign.com
TAB T=1
TAG POS=1 TYPE=FONT ATTR=TXT:2008<SP>Spring/Summer<SP>Collection
TAG POS=1 TYPE=U ATTR=TXT:Collection
TAG POS=1 TYPE=HTML ATTR=TXT:Wati,<SP>Clothing*
ONDOWNLOAD FOLDER="C:\Documents and Settings\Owner\Desktop" FILE=temp.pdf
WAIT SECONDS=10
TAG POS=1 TYPE=U ATTR=TXT:here
WAIT SECONDS=10 <<<<< It gets stuck here
PAUSE
Furthermore, if I stop the macro and then try to restart it, it then gets stuck on the VERSION step.
I also tried reversing the slant of the slashes in the ONDOWNLOAD step. And I also tried ONDOWNLOAD FOLDER=* FILE=* . No change.
So I still don't know how to save a pdf file on disk.
VERSION BUILD=6100118
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=watidesign.com
TAB T=1
TAG POS=1 TYPE=FONT ATTR=TXT:2008<SP>Spring/Summer<SP>Collection
TAG POS=1 TYPE=U ATTR=TXT:Collection
TAG POS=1 TYPE=HTML ATTR=TXT:Wati,<SP>Clothing*
ONDOWNLOAD FOLDER="C:\Documents and Settings\Owner\Desktop" FILE=temp.pdf
WAIT SECONDS=10
TAG POS=1 TYPE=U ATTR=TXT:here
WAIT SECONDS=10 <<<<< It gets stuck here
PAUSE
Dave Grossman
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
The event log looks like this - on and on and on
1/31/2008 6:29:41 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:41 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:42 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:42 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:43 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:43 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:44 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:41 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:42 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:42 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:43 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
1/31/2008 6:29:43 AM 3576 PDF>Skip internal BACKhttp://www.iopus.com/imacros/demo/v6/pdf/Inter ... 20Test.pdf
1/31/2008 6:29:44 AM 3576 Non-HTML document URL=http://www.iopus.com/imacros/demo/v6/pd ... 20Test.pdf
Dave Grossman
Have you tried adding CONTENT=EVENT:SAVETARGETAS? THe whole line would be
TAG POS=1 TYPE=U ATTR=TXT:here CONTENT=EVENT:SAVETARGETAS
As far as I can tell this simulates a right click and choosing save target. In most cases this has worked for me.
If that does not work you may want to go to windows explorer and go to Tools --> folder options --> File Types and find the .pdf extension and delete it. Doing this will make windows save the file when you click on it rather than open it since it won't know what program to use. On the downside when you need to open the file Windows won't know what program to use.
TAG POS=1 TYPE=U ATTR=TXT:here CONTENT=EVENT:SAVETARGETAS
As far as I can tell this simulates a right click and choosing save target. In most cases this has worked for me.
If that does not work you may want to go to windows explorer and go to Tools --> folder options --> File Types and find the .pdf extension and delete it. Doing this will make windows save the file when you click on it rather than open it since it won't know what program to use. On the downside when you need to open the file Windows won't know what program to use.
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
That seems to work
That works. Thank you very much! But I'm mystified as to how you knew that.
The User Manual does NOT list the TAG subcommand
CONTENT=EVENT:SAVETARGETAS
The user manual does list the TAG subcommands
CONTENT=EVENT:SAVETARGET and
CONTENT=EVENT:#SAVEITEM
but neither of them worked for me.
So, how did you know about SAVETARGETAS? Is there another better user guide somewhere that I don't know about?
The User Manual does NOT list the TAG subcommand
CONTENT=EVENT:SAVETARGETAS
The user manual does list the TAG subcommands
CONTENT=EVENT:SAVETARGET and
CONTENT=EVENT:#SAVEITEM
but neither of them worked for me.
So, how did you know about SAVETARGETAS? Is there another better user guide somewhere that I don't know about?
Dave Grossman
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
But there's still a problem for me
The problem is that I don't want to use the TAG command to get to the pdf page. I want to use the URL GOTO command to go there directly. And with URL GOTO, there is no subcommand CONTENT:... so the above method doesn't work.
I can probably code around this by creating on my disk a file temp.html with a link to the desired URL, then doing a URL=file://etc to get to the file on my disk, and then doing a TAG to click through to the URL with the pdf file. This would probably work, but it's incredibly silly. Does anyone know an easier way?
I can probably code around this by creating on my disk a file temp.html with a link to the desired URL, then doing a URL=file://etc to get to the file on my disk, and then doing a TAG to click through to the URL with the pdf file. This would probably work, but it's incredibly silly. Does anyone know an easier way?
Dave Grossman
- Tech Support
- Posts: 4948
- Joined: Tue Sep 20, 2005 7:25 pm
- Contact:
-
- Posts: 18
- Joined: Sun Jan 20, 2008 2:54 am
Avoiding the TAG command
By way of background, I should mention that I've been programming for over 50 years.
My application is a rather complex scripting system that I've written in perl. It involves retrieving a large number of files from a online repository of pdf files. It's quite important that I keep track of what I've already retrieved to avoid retrieving the same file more than once. So, it's necessary to process the repository index first. This index is not just on a single web page, but rather is on a 4-level hierarchy of web pages. As this process runs, it generates flat files of urls I want to retrieve.
The whole process has to be dynamic, because the repository I'm accessing tends to change the urls every day.
Once a flat file of urls is available, the process reads the urls and actually retrieves the files. For this purpose I was planning on using URL GOTO.
But since URL GOTO doesn't seem to allow downloading of pdf files, as a workaround I added a short script that determines the next file to download, writes a file temp.htm with that as the only link, and then TAGs to it. The TAG is able to do the pdf download.
Another way of accomplishing the same thing would have been dynamically to generate an HTML file of urls instead of generating a flat file of urls. The process could then TAG through all its links. It happens that I didn't write the code this way, but it wouldn't have been a big deal to modify it.
But it would have been nice if these sorts of workarounds weren't needed.
Anyhow, my workaround is written, and I'm in the process of debugging, so this is no longer a problem for me.
My application is a rather complex scripting system that I've written in perl. It involves retrieving a large number of files from a online repository of pdf files. It's quite important that I keep track of what I've already retrieved to avoid retrieving the same file more than once. So, it's necessary to process the repository index first. This index is not just on a single web page, but rather is on a 4-level hierarchy of web pages. As this process runs, it generates flat files of urls I want to retrieve.
The whole process has to be dynamic, because the repository I'm accessing tends to change the urls every day.
Once a flat file of urls is available, the process reads the urls and actually retrieves the files. For this purpose I was planning on using URL GOTO.
But since URL GOTO doesn't seem to allow downloading of pdf files, as a workaround I added a short script that determines the next file to download, writes a file temp.htm with that as the only link, and then TAGs to it. The TAG is able to do the pdf download.
Another way of accomplishing the same thing would have been dynamically to generate an HTML file of urls instead of generating a flat file of urls. The process could then TAG through all its links. It happens that I didn't write the code this way, but it wouldn't have been a big deal to modify it.
But it would have been nice if these sorts of workarounds weren't needed.
Anyhow, my workaround is written, and I'm in the process of debugging, so this is no longer a problem for me.
Dave Grossman