Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 5:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: How do you save an embedded program using a button?
PostPosted: July 12th, 2013, 1:05 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
I have a program that opens a "DocView" window. It opens an .xls file. When I get ready to save my changes, I do a ctrl+s on the keyboard. I would like to just be able to click a button provided to say the .xls file. I searched this site and found nothing, so I searched the internet and found that (Send ^s) is supposed to send the (ctrl s) command to the program that is open. I know that using ctrl and s on the keyboard works, so I tried using that information in a script...

Send ^s <SYSTEM_PUBLICATION_DIR>+score.xls

but can't get it to work. I tried several other variations and couldn't get them to work either. I feel certain that I'm off just a little, but can't find the magic combination. I tried it like this

Send ^s <SYSTEM_PUBLICATION_DIR>\\score.xls but the editor turned the back slashes red and said there was an error.

Any ideas? Will the Send^s or Send^S work in Opus or might there be something else that will work?

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 12th, 2013, 11:57 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Denn,

I can think of two possibilities. One is that of 'focus'. A button on the Opus page may not have control over an opened document in the DocView object.

Secondly, "sending" ^s ---- you may need to do some scripting to get at the ASCII Char Code, or rather to use the character derived from a specific ascii char code. Google ascii character table


btw, you may be able to expose certain Icons within the DocView window -- i.e., the 'Save' icon.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 13th, 2013, 8:25 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Thanks Lar, I have done each step as you suggested but still can not get it to work.

scripting to get at the ASCII Char Code, or rather to use the character derived from a specific ascii char code.

I can't write scripting in normal language much less what you said above.

btw, you may be able to expose certain Icons within the DocView window -- i.e., the 'Save' icon. Denn,

Worked on this over an hour and there is no way of putting the save icon on a document that would be used like I'm using it.

Anyone else? Maybe you Mack?

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 14th, 2013, 1:02 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Denn wrote:
and there is no way of putting the save icon on a document that would be used like I'm using it.
I played with this a bit and so far see no way to set this up within Opus prior to publishing.

I do see where a User can add Toolbar Icons by Right-clicking in the toolbar area and selecting 'Standard'. That includes the normal 'Save' icon. However, I find this works for .doc content in the DocView object, but not a .xls file. ???

I played also with
Code:
var xyz = String..fromCharCode("019")
eval(xyz)
but that did not work at all. I tried other variations off of this, to no avail. I conclude it is a matter of not knowing proper char coding for a 'Ctrl-S', and the DocView object not having focus at that time.

for Opus... maybe something can be done with Custom Action (on your button) and a Custom Trigger (under docview obj). Just do not know how to 'execute' the keystroke combination of Ctrl+S.

BTW, if the User makes a change to spreadsheet inside the docview obj, they can type Ctrl-s on their keyboard and the changes will be saved (if docview is the obj of focus).

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 14th, 2013, 2:26 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I re-read you OP. And see you want other than keyboard Ctrl-S. Also, regarding the "send ^s", you might be able to write a .BAT file that will perform that operation out in windows or VB. ??

Anyway, here is a workaround you may find acceptable.
Have your Button click run a script:
Code:
var otherFILE = "C:\\myDir01\\ShowBriefMessage.txt" ;
var originalFILE =  "C:\\myDir01\\theOrigFile.xls" ;
DocView_1.Navigate(otherFILE) ;           //the idea is to show a brief message, e.g. "please wait"
wait(4)                              //set the delay as short as you want
DocView_1.Navigate(originalFILE) ;
When I originally Preview my test Pub with the DocView, Windows prompts me to 'Open', 'Save', or 'Cancel'. You can instruct the User to check/uncheck the 'do not show again' option or 'ask me every time'...

With the above script, if the User made changes he will be prompted to Save or not before navigating to the brief file#2. You may be able to figure out a switch or parameter setting to bypass that.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Last edited by Lar_123 on July 14th, 2013, 9:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 14th, 2013, 6:39 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Lar_123 wrote:
I re-read you OP. And see you want other than keyboard Ctrl-S. Also, regarding the "send ^s", you might be able to write a .BAT file that will perform that operation out in windows or VB. ??

Anyway, here is a workaround you find find acceptable.
Have your Button click run a script:
Code:
var otherFILE = "C:\\myDir01\\ShowBriefMessage.txt" ;
var originalFILE =  "C:\\myDir01\\theOrigFile.xls" ;
DocView_1.Navigate(otherFILE) ;           //the idea is to show a brief message, e.g. "please wait"
wait(4)                              //set the delay as short as you want
DocView_1.Navigate(originalFILE) ;
When I originally Preview my test Pub with the DocView, Windows prompts me to 'Open', 'Save', or 'Cancel'. You can instruct the User to check/uncheck the 'do not show again' option or 'ask me every time'...

With the above script, if the User made changes he will be prompted to Save or not before navigating to the brief file#2. You may be able to figure out a switch or parameter setting to bypass that.


I'm not seeing in the code where it would actually save the .xls file which is the whole point. Keep in mind that I have trouble with English, much less script. What I'm trying to accomplish is for the end user to be able to click on one button and save the file, no other options for the end user. I do thank you for your help, but I'm still not getting it.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 14th, 2013, 6:39 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Lar_123 wrote:
I re-read you OP. And see you want other than keyboard Ctrl-S. Also, regarding the "send ^s", you might be able to write a .BAT file that will perform that operation out in windows or VB. ??

Anyway, here is a workaround you find find acceptable.
Have your Button click run a script:
Code:
var otherFILE = "C:\\myDir01\\ShowBriefMessage.txt" ;
var originalFILE =  "C:\\myDir01\\theOrigFile.xls" ;
DocView_1.Navigate(otherFILE) ;           //the idea is to show a brief message, e.g. "please wait"
wait(4)                              //set the delay as short as you want
DocView_1.Navigate(originalFILE) ;
When I originally Preview my test Pub with the DocView, Windows prompts me to 'Open', 'Save', or 'Cancel'. You can instruct the User to check/uncheck the 'do not show again' option or 'ask me every time'...

With the above script, if the User made changes he will be prompted to Save or not before navigating to the brief file#2. You may be able to figure out a switch or parameter setting to bypass that.

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 14th, 2013, 7:34 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
I'm not seeing in the code where it would actually save the .xls file which is the whole point.
Take Windows' Wordpad program or Notepad as an example. If I open an existing file, make some edits, and then 'Exit' or close that window --- windows automatically prompts me "do you want to save your changes?". So just by navigating away from orig file, User is prompted to save it.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 15th, 2013, 6:27 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Just test it out -- it either works for you or it does not.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 15th, 2013, 8:06 pm 
Offline
User avatar

Joined: March 12th, 2005, 10:31 pm
Posts: 140
Location: U.S.A. - Deep South
Opus: ver 7.06 - Opus Pro - Build 15130
OS: Windows XP Build 2600 Service Pack 3
System: (2) 3.2 CPUs Intel - (2) gigs ram - 3.2 tb HD
Lar_123 wrote:
Just test it out -- it either works for you or it does not.



Lar, when I open the Opus program that I created and running the xls sheet embedded in it, and I make changes, I can already simply press on (Ctrl and S) on the keyboard and save any changes on the .xls sheet. So I have a way of saving it already. What I'm trying to do is make it simple by having the end user click on a button rather than having to stop what they're doing and search for those two keys to press. So I'm trying to send that Ctrl S by means of a button.

Sorry for not being clear enough in my explanation...
Dennis...

_________________
PlanetDenn.com
Lots of Fun Freeware
Image


For this message Denn has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: How do you save an embedded program using a button?
PostPosted: July 16th, 2013, 12:29 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Denn wrote:
So I'm trying to send that Ctrl S by means of a button.
Sorry for not being clear enough in my explanation...
Denn,
You were clear, and I understood that. Maybe I was not clear enough.

re: sending ^s
Maybe you can do that with some scripting in a .BAT file (not Opusscript here, but some WKS or VB Script or whatever accesses Windows functions).

Otherwise, the workaround I proposed is 'Yes' a Button the User clicks (button on the Opus Page). As outlined above however, after Opus button-click, the User may have to click again --- on the Windows prompt that asks to confirm 'Save' the file.
Again, try it -- if it is not an acceptable solution, then we keep looking.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


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

All times are UTC [ DST ]


Who is online

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