2 Replies Latest reply on Dec 25, 2006 1:44 PM by Newsgroup_User

    open file using a specific program

    instructorTek
      Hi all. I have a director movie and when I click a button I would like to play
      an .avi movie using a specific player which I'm distributing together with the movie.
      I'm running into some problems, I can't get the moviePath command to work with lingo's open command so as to specify the absolute path and if I use BuddyAPI I'm not getting the baOpenFile command to open the .avi with a specific program. Please help.

      open "OpenWordMajor.avi" with "CamPlay.exe"
      --this would work if I get a way to add the path to the .avi

      baOpenFile( the pathName & "OpenWordMajor.avi" , "maximised" )
      --this could have worked if I get it to play the .avi with CamPlay.exe
        • 1. Re: open file using a specific program
          Level 7
          On Mon, 25 Dec 2006 17:29:40 GMT, instructorTek posted in
          macromedia.director.lingo:

          > Hi all. I have a director movie and when I click a button I would like
          > to play an .avi movie using a specific player which I'm distributing
          > together with the movie.
          >
          > open "OpenWordMajor.avi" with "CamPlay.exe"
          > --this would work if I get a way to add the path to the .avi

          Are both the .avi and the .exe in the same path as the projector?

          open theMoviePath &"OpenWordMajor.avi" with the moviePath &"CamPlay.exe"

          Is there a chance there are spaces in the path? Some programs don't like to
          see spaces in path names. Some will accept enclosing the path/fileName in
          quotes.

          myFile = QUOTE &the moviePath &"OpenWordMajor.avi" &QUOTE
          myApp = QUOTE &the moviePath &"CamPlay.exe"
          open myFile with myApp

          When Lingo's 'open' command fails, it does so silently, giving you and the
          end user no clue as to why it failed.

          Since you have Buddy API, I highly recommend using it over Lingo's 'open'
          command. Its functions provide a return code that can tell you pass/fail and
          sometimes the reason for failure.

          > baOpenFile( the pathName & "OpenWordMajor.avi" , "maximised" )
          > --this could have worked if I get it to play the .avi with CamPlay.exe

          baOpenFile will only open files with their associated application - not with
          a specified application. Use baRunProgram or baShell for this. See the Buddy
          API docs for the specific parameters (I'm not on a machine with Dir right
          now)

          The spaces/quotes issue may still apply (depends on the application, mostly).
          Another Buddy method that might help, if running on Windows, is
          baShortFileName().

          And do take advantage of the return code. Most of the examples in the Buddy
          docs use OK = functionName(). The OK variable will contain the return code
          that is documented in the docs.

          You can see a good example of how to use its error codes in one of Andrew
          Morton's posts to this group (this happens to be for baOpenFile, but you can
          adapt it to baRunProgram's return codes).

          http://tinyurl.com/yblwzh


          --
          Mark A. Boyd
          Keep-On-Learnin' :)
          • 2. Re: open file using a specific program
            Level 7
            On Mon, 25 Dec 2006 21:39:59 GMT, Mark A. Boyd posted in
            macromedia.director.lingo:

            > open theMoviePath &"OpenWordMajor.avi" with the moviePath &"CamPlay.exe"

            Needs a space in case you missed it.

            open the moviePath &"OpenWordMajor.avi" with the moviePath &"CamPlay.exe"

            I still recommend Buddy API, though.


            --
            Mark A. Boyd
            Keep-On-Learnin' :)