PDA

View Full Version : How to detect file.open error if no app?



svanetempest
01-30-2004, 05:36 AM
I am about to purchase the standard edition, and want to know if when one tries the file.open on a pdf file, is there a way to detect if it launched correctly? Thereason is to establish if acrobat is installed on the target system. I know the pro version allows for checking, but for just this one event I am not sure about paying the cost difference in software.

If there was a simple way to know if the file.open worked or failed then at least a message could be posted.

Many thanks

Stewart

Corey
01-30-2004, 05:55 AM
Hi. About the file.open actions from the following page, "Returns
Nothing. You can use Application.GetLastError to determine whether this action failed, and why.".

http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/File.Open.htm

So basically you would use this to figure out if it hadn't loaded properly:

http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/Application.GetLastError.htm

Hope that helps. :) Glad to have you in the forum!

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

svanetempest
01-30-2004, 06:04 AM
Thanks!

I will probably check the variable number returned for a wide range of values so that if it failed one can then post a Dialog.Message appropriately to tell the user to check that Acrobat is installed.

Regards,

Stewart

Corey
01-30-2004, 06:19 AM
Sure. Or if you go to PROJECT > DEPENDENCIES you can set the requirement for Adobe Acrobat there also. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

CWRIGHT
01-30-2004, 06:48 AM
The File.GetDefaultViewer action is available in the standard edition. You could use this to check for the existance of a PDF viewing application. Something like:

viewer_path = File.GetDefaultViewer(".pdf");

if (viewer_path == "") then
Dialog.Message("Notice", "There is no PDF viewer installed.");
end

Corey
01-30-2004, 06:51 AM
Ah yes, oops, I missed where you mentioned standard version. :o Great tip CWRIGHT!

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

svanetempest
01-30-2004, 08:54 AM
Excellent advice - tried it and everything looks fine now.

Not sure if this thread is the correct place, but seeing how helpful you have been.....

Does the 'standard' version differ from the trial? Just that on startup, the software seems to check for macromedia flash, yet I have used no flash objects at all in the show. I have looked through the entire project and there are no files with the .swf extension either.

Can this be disabled or will it always show up regardless? Just that on many NT servers, this could be quite annoying everytime the runtime presentation starts.

Thanks!

Corey
01-30-2004, 12:09 PM
Hi. Start a new, completely blank project. You will notice that there is now no flash check. Flash checks onlyoccur where you set them to... Hope that helps. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)