Page 1 of 1

Launch and url do not open file

Posted: Sat Sep 20, 2014 3:48 pm
by user#606
Using either of the code choices below will open a document or pdf as expected, however, if I wish to open a journal file, they do not work.
The idea was that a document based file (never an exe or such) could be opened with the correct application (if the user created the document, they would have the appropriate application) and this document type might vary.

My first thought was that the complete path was defective, though it worked with pdf, txt, doc, but not .jtp (journal).
The copy and pasted full path worked perfectly with .jtp when pasted into the address field of My Computer. So I concluded the error was neither address/path or an unassociated application.

Code: Select all

on mouseUp
   launch  field "DocPaths"
     --launch url "file:" & field "DocPaths"
end mouseUp
The question is, how can I have the intended flexibility of open able document based files?

Re: Launch and url do not open file

Posted: Sat Sep 20, 2014 7:06 pm
by Simon
Hi user#606,
Just to check, does double clicking on the .jtp file launch it?

Simon

Re: Launch and url do not open file

Posted: Sun Sep 21, 2014 2:35 pm
by Klaus
Hi all,

the trick is to use "launch DOCUMENT xyz"! 8)

Code: Select all

...
put fld "DocPaths" into tDoc
launch document tDoc
## Now check the result to see if any error happened like no application associated with the suffix or whatever:
if the result <> EMPTY then
  answer "Problem:" && the result
end if
...
Best

Klaus