PDA

View Full Version : Pop-up plug



Bruce
02-21-2004, 01:09 PM
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=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

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

Worm
02-21-2004, 01:20 PM
I think you need to change this line:

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

Bruce
02-21-2004, 02:12 PM
Hummm that didn't work but thanks worm!

Worm
02-21-2004, 02:23 PM
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

Bruce
02-21-2004, 02:23 PM
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

Corey
02-21-2004, 02:24 PM
Ka-ching!

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Worm
02-21-2004, 02:33 PM
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.

Bruce
02-21-2004, 04:39 PM
SWEET! Thanks Worm!