Pop-up plug

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2133

    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!
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3967

    #2
    I think you need to change this line:

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

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2133

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

      Comment

      • Worm
        Indigo Rose Customer
        • Jul 2002
        • 3967

        #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

        • Bruce
          Indigo Rose Customer
          • Jun 2001
          • 2133

          #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

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9741

            #6
            Ka-ching!

            Corey Milner
            Creative Director, Indigo Rose Software

            Comment

            • Worm
              Indigo Rose Customer
              • Jul 2002
              • 3967

              #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

              • Bruce
                Indigo Rose Customer
                • Jun 2001
                • 2133

                #8
                SWEET! Thanks Worm!

                Comment

                Working...
                X