Launch and url do not open file

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Launch and url do not open file

Post by user#606 » Sat Sep 20, 2014 3:48 pm

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Launch and url do not open file

Post by Simon » Sat Sep 20, 2014 7:06 pm

Hi user#606,
Just to check, does double clicking on the .jtp file launch it?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Launch and url do not open file

Post by Klaus » Sun Sep 21, 2014 2:35 pm

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

Post Reply