Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently October 7th, 2024, 11:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Launching pps file from different OS's - for Mack again
PostPosted: June 22nd, 2010, 5:50 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
Mack,

You put this script together for me to launch pps files.

It works fine, except if the user is on Win 7 Professional (64).

Can you help again?

var myFile = SYSTEM_PUBLICATION_DIR+"\Powerpoint\\STS01.pps"

if (FileExists("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE",myFile)
} else
{
Debug.trace('Viewer Not Found')
}

Thanks, Linda

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: June 23rd, 2010, 7:47 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
32bit applications are not kept in Program Files under a x64 OS. They are located in the Program Files (x86). You'll need to duplicate the entire nested IF statements (minus the last debug bit) and change the paths to reflect the directory change.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: June 24th, 2010, 1:29 am 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi,

I tried this in a LaunchFile script, and it works on my Windows 7 x 64 bit machine:

Code:
SYSTEM_PROGRAMS_DIR + "\\Microsoft Office\\Office12\\PPTVIEW.exe"


So, you may be able to substitute SYSTEM_PROGRAMS_DIR into the script for the x86 program directory.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: June 24th, 2010, 7:44 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Morning Stephen,

Yes, you could use the system variable in place of the (x86) directory because it's being called from Opus which is 32bit and thus will pick up the 32bit program directory. Probably should have used this in the original script but it's one of those concepts that has grown more unwieldy over time. If this was the case, the script would work for 32bits applications under x64 or x86 without further modification BUT as Microsoft have thrown Office x64 into the affray, Linda will need to check both paths and I assume add a check for Office 2010.

I do think that the solution is becoming a little convoluted and impractical and have added a possible alternative launch command to our new toolbox DLL for people to play with to see if this is a better alternative. It's .net and thus not great for XP unless people provide their publications via a professional installer but both Vista and 7 will work out-of-box so could be very useful as XP dies off.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 9:38 am 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
Mack,

I didn't bother implementing the Win7 pro bit of the scrip

(Wasn't sure i'd get it right, and client didn't need win 7 today)

However, one bug has come up:

Say the whole pub is in a directory called Publish.

Then within it, there's the powerpoint directory with my powerpoint sts01.pps etc.

This works fine.

But: if the Publish directory is moved into another folder, one with a space in the name, the powerpoints no longer work.

So d:/Supplies Team/Publish/sts.exe will not run the powerpoints, while

d:/SuppliesTeam/Publish/sts.exe will.

...

Do I just need to tell the client the rule is no spaces, or is there an easy answer?

Thanks, Linda

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 2:23 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Linda wrote:
(Wasn't sure i'd get it right, and client didn't need win 7 today)


For clarity, it's not W7 that's causing the problem it's the 64bit OS. Both XP & Vista have x64 versions and if these use the same directory structure would also cause the problem.

As for the second glitch - yes a space would as you're breaking the string. You'll need to wrap everything in single quotes:

'"D:\\my Powerpoint\\cam.pps"'

IE Open single (') open double (") - text - close double (") close single(')

Mack

P.S forgot to ask what program did you end up using to encode the WMVs?

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 2:34 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
mackavi wrote:
For clarity, it's not W7 that's causing the problem it's the 64bit OS. Both XP & Vista have x64 versions and if these use the same directory structure would also cause the problem.


Ok, I'll write out the whole script as I think you've suggested, and get you to run your eyes over it once more, thanks.

mackavi wrote:
As for the second glitch - yes a space would as you're breaking the string. You'll need to wrap everything in single quotes:


Ah - thank you. I'll fix this

mackavi wrote:
P.S forgot to ask what program did you end up using to encode the WMVs?


We've just got two new CS5 systems going here, so I encoded from Adobe Media encoder. The presentation was extra widescreen (1366 x 768) so I encoded the videos at 1214 x 626 to fit, at 2000kbps.

Looked good.

Linda

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 3:07 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
Mack, please can you check this powerpoint script: Thanks, Linda

var myFile = SYSTEM_PUBLICATION_DIR+'"\Powerpoint\\STS01.pps"'

if (FileExists("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE",myFile)
}

if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office\Powerpnt.exe"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office\Powerpnt.exe",myFile)
} else if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office11\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office11\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE",myFile)
}


else
{
Debug.trace('Viewer Not Found')
}

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 4:07 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Linda,

Almost perfect, but I'd suggest connecting the two blocks with an else:

var myFile = SYSTEM_PUBLICATION_DIR+'"\Powerpoint\\STS01.pps"'

if (FileExists("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office\Powerpnt.exe",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office11\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files\\Microsoft Office\\Office12\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office\Powerpnt.exe"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office\Powerpnt.exe",myFile)
} else if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office11\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office11\\PPTVIEW.EXE",myFile)
} else if (FileExists("C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE"))
{
LaunchFile("C:\\Program Files (x86)\\Microsoft Office\\Office12\\PPTVIEW.EXE",myFile)
}


else
{
Debug.trace('Viewer Not Found')
}

This will end the ifs on the first occurrence of PowerPoint. Without it, it which check both blocks independently and if for some odd reason there are two versions installed, it will launch twice.

Regards,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 6:25 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
Mack, it's not quite working for me:

I installed powerpoint viewer on a win7x64 pc.

This default installation installs at c:/program files (x86) /Microsoft office / office 12 / pptview.exe

When I run the script, and click on the powerpoint button, the viewer starts:

> I first get a message saying Powerpoint viewer cannot find the file " ".

> When I click OK on the error message, the powerpoint slide opens correctly anyhow.

Help !

I searched my drives, but there is only one pptview.exe, and no powerpnt.exe files.

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 2nd, 2010, 9:30 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hadn't realised that there was a variable in the string.

var myFile = '"' + SYSTEM_PUBLICATION_DIR+"\my Powerpoint\\STS01.pps" + '"'

Open single open double close single then + variable then + and open double - text close double then + open single close double (from start) close single.

Anything worse and I'll need a stronger drink :-)

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Launching pps file from different OS's - for Mack again
PostPosted: July 4th, 2010, 10:45 pm 
Offline

Joined: October 25th, 2004, 1:21 pm
Posts: 424
Location: West Lancs, UK
Opus: 7
OS: Xp, Win7
mackavi wrote:
var myFile = '"' + SYSTEM_PUBLICATION_DIR+"\Powerpoint\\STS01.pps" + '"'

That worked!

I'm sending you, and the client, a final file - no more checking, it's just so you can see the fruit of your efforts.

The wmv files are all now set to on top too (with the chroma key setting, Mack pointed out that it was very easy to crash the pub)

Many thanks for all your help over the last week.

Thanks again, Linda

_________________
Linda Rossiter, Rossiter & Co

Pro 8, Pro 7, Pro 6, Pro 05.5XE, Pro 04XE, XE2.8, ILM 4.5 on Win7 Professional


For this message Linda has been thanked by : mackavi


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group