Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 18th, 2024, 11:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 2nd, 2016, 11:09 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
Dear All
I have created an MS Powertpoint TEMPLATE called MyTemplate.POTX . Notice the .POTX extension.
Normally when you launch a .potx file from file Explorer, you get an instance of the file with a .PPTX extension.
So in this example, when I launch the template I should get MyTemplate.PPTX. Notice the extension is now different.

This functionality does not work in OPUS so I am trying to use a program switch by passing a parameter to Powerpoint.
The parameter I am using is this:

/N "MyTemplate.potx"

According to the Microsoft site, this switch opens a new presentation based on a template with the specified name.

How come this switch does not work?

Yours
Pakapaka


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 3rd, 2016, 11:08 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
This function launches a file as if it were double clicked in Windows itself.

Just add it to Script object and the call launchPowerpoint(f) where 'f' is the path & name of the file.

Code:
ShellDLL = LoadDLL(SYSTEM_WINSYS_DIR + "Shell32.dll");

function launchPowerpoint(f){
var result = ShellDLL.CallFn("ShellExecuteA", false, "slong", "hwnd", 0, "slong", 0,"string", f,"slong", 0,"slong", 0,"slong", 1);
}


</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: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 3rd, 2016, 2:41 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
Hi Mack
Long time no see :D
I added a Script object to a button and copied your code into the script box.
Also changed the path to this
Code:
ShellDLL = LoadDLL(SYSTEM_WINSYS_DIR + "Shell32.dll");

function launchPowerpoint(SYSTEM_PUBLICATION_DIR\\Powerpoint Resource\\Template.potx\\){
var result = ShellDLL.CallFn("ShellExecuteA", false, "slong", "hwnd", 0, "slong", 0,"string", f,"slong", 0,"slong", 0,"slong", 1);
}


Got Nada.. didn't work.
I assume this function is instead of the Launch File action...so I did not use that action
Your help is appreciated


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 3rd, 2016, 2:54 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
That would be because you don't use a function like that, you pass the value to 'f', not replace it:

Code:
//The CALL - place in script object or script action
launchPowerpoint("SYSTEM_PUBLICATION_DIR\\Powerpoint Resource\\Template.potx\\")


//LOADS THE DLL
ShellDLL = LoadDLL(SYSTEM_WINSYS_DIR + "Shell32.dll");

//THE FUNCTION
function launchPowerpoint(f){
var result = ShellDLL.CallFn("ShellExecuteA", false, "slong", "hwnd", 0, "slong", 0,"string", f,"slong", 0,"slong", 0,"slong", 1);
}


Our training lessons - number ten - cover using scripting and functions:

https://www.youtube.com/playlist?list=P ... 4ucrELVYhq

</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: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 3rd, 2016, 8:50 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
I copied the code example you sent into the script object, but I get "Expression Contains Errors".
Also viewed the tutorial twice, but as a non-programmer, I failed to see the relevance of tuttorial #10 tothe specific task at hand.

Will find some time to do some reading tomoro and let you know if I can solve this


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 3rd, 2016, 9:38 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
Hi Mack
Ignore my previous email...I made some progress (I think)

This is what I done so far.
First I created a Script Object and placed it on the page.
The script object contains this part of the code you sent:
Code:
//THE FUNCTION
function launchPowerpoint(f){
var result = ShellDLL.CallFn("ShellExecuteA", false, "slong", "hwnd", 0, "slong", 0,"string", f,"slong", 0,"slong", 0,"slong", 1);


I renamed the Script Object (f) in the Object Explorer (just seemed logical to me)

Second I created a Button and added a SCRIPT ACTION to the Left Mouse click Trgger
The script action contains this code
Code:
//The CALL - place in script object or script action
launchPowerpoint("SYSTEM_PUBLICATION_DIR\\Powerpoint Resource\\Template.potx\\")

//LOADS THE DLL
ShellDLL = LoadDLL(SYSTEM_WINSYS_DIR + "Shell32.dll");


When I run the publication and click the button, I get this error
Code:
MainPage,f : Errors parsing script
MainPage,Button_1[121] [2] : Undefined identifier 'launchPowerpoint'


Did I set everything up correctly?
if not can you point me in the right direction
thanks
Pakapaka


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 4th, 2016, 7:31 am 
Offline
Godlike
Godlike
User avatar

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

http://files.interaktiv.co.uk/forum/pplaunch.zip

</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: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 4th, 2016, 10:29 am 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
Hi Mack
Thank you for this.
This is a very important example and you should post it in the Showcase Section.
I have seen quite a few users who need this kind of functionality

I am going to now play with your example for Word templates.
This means creating a .docx file based on a .dotx.

I assume I can replace the "launchPowerpoint (f)" function with a "launchWord (f) function.
What is this? How does Opus recognise Powerpoint and Word, is it a built-in function?
Yours
Pakapaka


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 4th, 2016, 11:18 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It has nothing to do with Word or PowerPoint. You could call it goFish(f) and it will launch any type of file according to it's normal Windows' double click action.

The Shell32.dll is doing all the hard work and it belongs to the Operating System NOT Opus.

I assume that Opus' method uses the 'open' action rather than the default behaviour for the filetype. Right click a file to see all the actions.

</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: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 4th, 2016, 2:52 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
Thank you for the info..check your email


For this message pakapaka has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 5th, 2016, 7:02 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No email came through, did you use the address or form on the website?

</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: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 6th, 2016, 9:37 pm 
Offline

Joined: May 15th, 2015, 8:30 am
Posts: 59
Opus: 9.0
OS: Win 7
System: Icore 7
I sent u 2 emails

Please confirm u received


For this message pakapaka has been thanked by : mackavi


Last edited by pakapaka on February 7th, 2016, 9:13 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Launch File: Passing Parameters Option Does Not Work.
PostPosted: February 6th, 2016, 10:39 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
No, not yet. But have one from our contact form.

Do me a favour and remove our email from the post, as it'll get harvested by spam bots.

</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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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