reading PDF files

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

reading PDF files

Post by MacschedStudent » Mon Dec 31, 2007 7:08 pm

Hi guys:

I am currently using MSched 7.4.009 20/10/2005

If I use the RLN command or ReadFile and attempt to open and read a PDF file and display the contents in a message what I get is the format of the file but none of the data - meaning an empty PDF file. So the logic that follows fails when attempting to work with the file contents. However, if I take that same file and manually rename the extension to .txt and open it all of the data is there.

So just to make sure were clear, if I RLN 10 on the PDF I get something like "n00000006" which is basically an empty line in PDF. But if I change that file to a txt extension and then use RLN to read that same file I get a full line of text. Is this a limitation with MSChed ???

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Mon Dec 31, 2007 9:23 pm

With the file I tried I don't see any difference in the result with renaming the file from .pdf to .txt. Since Help for ReadLn says "Reads the specified line from the given text file." I guess I wouldn't expect it to work with a .pdf because that's not a plain text file type.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 01, 2008 12:20 am

I haven't tried this because I no longer have access to version 7.

A specific application accessing a file may read the file's name and treat the file in a manner specific to the file's 3 character extension. Otherwise, nothing about reading a file is changed when a file is renamed. Renaming a file does nothing to alter the actual contents of the file.

File extension association to a specific application is based on information stored in the Windows Registry and has absolutely nothing to do with the contents of the file. I would be surprised to hear that the Readln> function has at any time been associated in any way with a particular file extension and would therefore be susceptible to altering its behavior based on a file's name.

I can tell you that PDF files can contain ASCII control characters that will not be displayed in a Macro Scheduler message. I can also tell you that I'm 99% certain that changing a files name from .PDF to .TXT will not change what gets read by ReadLn> and displayed in a message. Something else had to be changed for your results to be different. Different file or different line number... something.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 01, 2008 12:26 am

Yes, as JRL says, the file extension has no bearing on the contents of the file and changing it will make absolutely no iota of a difference to the content. You could rename a .pdf file to a .txt, or .who, or .whatever file and you would still get exactly the same data when reading it with ReadLn.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MacschedStudent
Junior Coder
Posts: 36
Joined: Fri Oct 12, 2007 5:55 pm
Location: federal way wa
Contact:

Post by MacschedStudent » Tue Jan 01, 2008 7:41 am

Hi guys thanks for the in-depth and prompt reply. I see no value in chasing down a problem that may not be able to be replicated with the newer version of MSched. I will redo my testing and if the results are the same I will forward you the PDF and the click-per-click steps I took to arrive at the anomaly - thanks.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts