IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Is there any way in a script to specify . .
. . that if a program is open to use that instance rather than start another one?

for an automated email fetch, PMMail calls In-Joy to dial, using a very short script:
CD \\INJOY
INJOY.EXE
EXIT

InJoy times out in 120 seconds, but should it not time out for some reason, and holds the connection, the next time PMMail calls the dialer a second instance is opened and things get screwed up.

I know the Icon properties allow selecting to use an existing window, so I presume the command line can do that somehow.

[link|http://www.aaxnet.com|AAx]
New I don't know about plain Rexx...
You may need something like [link|http://www.devtech.com/DeskMan/|DeskMan/2].

Here's what my version 1.51 of DeskMan/2 says about PerfOpen.cmd:

/* REXX OS/2 - PerfOPEN.CMD Open a view of an object */
/*-──────────────────────────────────────────────────────────────────┐
│ │
│ (C) Copyright 1993-1994 Development Technologies, Inc. │
│ Portions Copyright 1993 Gregory Czaja │
│ All rights reserved │
│ DeskMan, DeskMan/2, DM2Setup, VUEMan, VUEMan/2 and DM2Image │
│ are trademarks of Development Technologies, Inc. (DevTech), │
│ a Pennsylvania Corporation │
│ │
│ version 1.51 April 1994 │
└───────────────────────────────────────────────────────────────────*/
/*───────────────────────────────────────────────────────────────────┐
│ Performs a wpOpen function on the specified object │
│ located in the FolderName-folder │
│ Note: a variation of the PerfSET.CMD │
│ │
│ The folder and object names should be surrounded by " │
│ if containing blanks. │
│ │
│ The format is: │
│ PerformSetup=objectName,FolderName,OPEN=View │
│ │
│ objectName can be: . object title │
│ . object ID │
│ . fully qualified path │
│ │
│ note: if an object ID (i.e., a character string enclosed │
│ in brackets <>) is used as the object name, the │
│ object's location specified as FolderName will be │
│ IGNORED! - but needs to be specified. │
│ │
│ FolderName can be: . folder title │
│ . object ID │
│ . fully qualified path │
│ . ANYWHERE │
│ note: if ANYWHERE is specified as the object's location, │
│ the entire Desktop will be searched for the object │
│ specified (top-down). First object found will be │
│ used. │
│ │
│ View can be: . DEFAULT - the default view of an │
│ object will be opened, simulates │
│ a double-click on an object │
│ . DETAILS (folder only) - the Details │
│ view will be opened │
│ . ICON (folder only) - the Icon view │
│ will be opened │
│ . TREE (folder only) - the Tree view │
│ will be opened │
│ . SETTINGS - the Settings will be │
│ opened │
│ │
└───────────────────────────────────────────────────────────────────*/


Presumably if the object it setup properly, this will work correctly for you.

Warning though, I haven't used DM/2 in several years.

HTH.

Cheers,
Scott.
(Sorry about the formatting...)
New Alternatively...
Does your version of InJoy have Dial-On-Demand? If so, it should negate the need for a script - just turn it on and set the relevant timeouts, etc. InJoy would do it's magic when called by PMMail. If not (it does cost more), then you'll need a script I guess.

Cheers,
Scott.
New Yes, I (and my client) have SOHO
That version includes Dial on Demand, which I didn't think of using, but will try if there's problems. Thanks.
[link|http://www.aaxnet.com|AAx]
New Re: Is there any way in a script to specify . .
Why not create a flag file when pmmail opens injoy? Something like this:

/* Check for file */

call sysfiletree 'injoy.flg', 'injoy', 'FO'

if injoy.0 = 0 then /* No file exists */
do
address cmd 'cd \\injoy' /* Get thee hence to the injoy directory */
/* Create the flag file */
call stream 'injoy.flg', 'C', 'OPEN'
call lineout 'injoy'flg', 'This is injoy's flag file'
call stream 'injoy.flg', 'C', 'CLOSE'
/* Run injoy */
address cmd 'injoy.exe'
call sysfiledelete 'injoy.flg' /* Delete the flag file */
end


I may have screwed up a call or two... just running from memory as to syntax, so check the calls in your docs.

Of course, injoy's DOD feature means you don't really have to do this, but this technique can work with any other program you may need to call but have only one instance of...
--
-------------------------------------------------------------------
* Jack Troughton jake at consultron.ca *
* [link|http://consultron.ca |[link|http://consultron.ca|http://consultron.ca] ] irc.ecomstation.ca *
* Laval Qu\ufffdbec Canada [link|news://news.consultron.ca|news://news.consultron.ca] *
-------------------------------------------------------------------
     Is there any way in a script to specify . . - (Andrew Grygus) - (4)
         I don't know about plain Rexx... - (Another Scott)
         Alternatively... - (Another Scott) - (1)
             Yes, I (and my client) have SOHO - (Andrew Grygus)
         Re: Is there any way in a script to specify . . - (jake123)

I'm sorry Dave, but Dave's friend Dave says Dave's at Dave's house.
56 ms