Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Pop-up plug

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pop-up plug

    I'm attemping to call a .pdf file from the pop-up plug and was wondring what I was doing wrong.

    -- Show a popup menu at the coordinates of a lable object called "Label1"
    tblPos = Label.GetPos("Label1");
    tblSize =Label.GetSize("Label1");

    x = tblPos.X;
    y = tblPos.Y + tblSize.Height;

    tblMenu =
    {
    {text="Price Sheet",type=0,checked=false,enabled=true},
    {text="Countertop",type=0,checked=false,enabled=tr ue},

    };

    strSelected = PopupMenu.Show(tblMenu,x,y,PopupMenu.HALIGN_LEFT,P opupMenu.VALIGN_TOP);

    if (strSelected ~= "CANCELLED") then
    path_short = File.GetShortName(_SourceFolder);
    File.Run("Acrobat 6.1\\Reader\\AcroRd32.exe", "AutoPlay\\Docs\\(strSelected)", "", SW_SHOWNORMAL, false);


    end

    Reader starts up great but can't read the .pdf!

  • #2
    I think you need to change this line:

    File.Run("Acrobat 6.1\\Reader\\AcroRd32.exe", "AutoPlay\\Docs\\".. strSelected, "", SW_SHOWNORMAL, false);

    Comment


    • #3
      Hummm that didn't work but thanks worm!

      Comment


      • #4
        I don't have the popup menu plugn, but I'm guessing that you're not getting a filename back in your strSelected variable.

        Try adding the PDF extension:
        File.Run("Acrobat 6.1\\Reader\\AcroRd32.exe", "AutoPlay\\Docs\\".. strSelected ..".pdf", "", SW_SHOWNORMAL, false);

        Or use the
        Dialog.Message("Variable Value", strSelected)

        to see what you are actually passing to the File.Run action

        Comment


        • #5
          Got it! I needed to add the .pdf to the end of the name along with your fix Worm... Thanks!.

          -- Show a popup menu at the coordinates of a lable object called "Label1"
          tblPos = Label.GetPos("Label1");
          tblSize =Label.GetSize("Label1");

          x = tblPos.X;
          y = tblPos.Y + tblSize.Height;

          tblMenu =
          {
          {text="Price Sheet.pdf",type=0,checked=false,enabled=true},
          {text="Countertop.pdf",type=0,checked=false,enabled=true},

          };

          strSelected = PopupMenu.Show(tblMenu,x,y,PopupMenu.HALIGN_LEFT,P opupMenu.VALIGN_TOP);

          if (strSelected ~= "CANCELLED") then
          path_short = File.GetShortName(_SourceFolder);
          File.Run("Acrobat 6.1\\Reader\\AcroRd32.exe", "AutoPlay\\Docs\\".. strSelected, "", SW_SHOWNORMAL, false);

          end

          Comment


          • #6
            Ka-ching!

            Corey Milner
            Creative Director, Indigo Rose Software

            Comment


            • #7
              Bruce, if you don't want the ".pdf" to show up in the menu, use the line I posted. It adds the extension after the selection has been made.

              Comment


              • #8
                SWEET! Thanks Worm!

                Comment

                Working...
                X