problem with "launch" in a standalone

Peter M. Brigham pmbrig at gmail.com
Mon Nov 25 22:10:10 EST 2013


So I have a handler that runs fine in the IDE, and even when I suspend the development tools it runs fine, but when I build the standalone it fails. The idea is to be able to store the locations of images and display them in the default image app when they are chosen from a pop-up list. In the standalone, when I select the name of the image from the pop-up, nothing happens.

The script of my pop-up button includes the following (see the bottom section for where the problem lies):

on menuPick u
   -- each card has a property storedImages
   -- which is an array of one or more images and info
   -- if <uTitle> is the title of the image, then
   --    each storedImages[<uTitle>] is an array:
   -- storedImages[<uTitle>]["uImage"] is an image
   -- storedImages[<uTitle>]["uFilepath"] is the location of the image file
   -- storedImages[<tTitle>]["uExtension"] is the file extension (file type) -- jpg, png, pdf, etc.
   
   put the shiftkey is down into deleting
   switch
      case u contains "store"
         answer file "Choose your image:"
         if it = empty then exit to top
         put it into tPath
         importImage tPath
         break
      default
         -- an image title was selected
         put the storedImages of this card into rImages
         if deleting then
           …  <snip> ..
         else -- display image

            ******** this is the part that isn't working: ********

            put rImages[u]["uImage"] into tImage
            put rImages[u]["uFilepath"] into tFilepath
            put lastThing(tFilepath,"/") into shortFileName
            if there is a file (tFilepath) then
               launch document tFilepath
               if the result <> empty then
                  answer the result as sheet
               end if
            else…
                  <snip>

The fact that I don't get an error answer dialog means that the launch command is not returning any indication of a problem. Any suggestions? 2008 MacBook, OSX 10.7.4 (Lion), Rev Studio 5.5.1, build 1487. Yes, I'm still running an older version of LC.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list