Topic: Extending opencurs.vdm (1 of 8), Read 40 times
Conf: Keyboard, keystroke macros
From: Ian Davies
Date: Friday, May 12, 2006 04:53 PM

I find the macro opencurs.vdm a most useful (and much used) part of Vedit.

It occurs to me to wonder if anyone has written something similar but extending the method to open other sorts of files using the same technique. For example it would be great if browsing a list in Vedit, I could "open" say a .JPG file, or a .PDF file, using the default application.

Implementing this is a bit beyond me, but I'm sure it's possible and potentially I think quite useful because in editing a list of say, .MP3, .JPG or .PDF files the user could quickly check that the file should remain part of the collection.

Suggestions anyone?

 


Topic: Re: Extending opencurs.vdm (2 of 8), Read 38 times
Conf: Keyboard, keystroke macros
From: Christian Ziemski
Date: Friday, May 12, 2006 05:55 PM

On Fri, 12 May 2006 16:53:00 -0400, Ian Davies wrote:

>I find the macro opencurs.vdm a most useful (and much used)
>part of Vedit.
>
>It occurs to me to wonder if anyone has written something
>similar but extending the method to open other sorts of files
>using the same technique.
>For example it would be great if browsing a list in Vedit,
>I could "open" say a .JPG file,
>or a .PDF file, using the default application.
>...
>
>Suggestions anyone?


The key is the Windows command "start".

For example you can call "start dog.jpg" in a DOS box and the standard
application for JPGs will be used to display the file.

I'm using that for example in my HYPERTXT.VDM which can navigate
within text files or open foreign files via their application.


It should be no problem to modify/enhance/duplicate OPENCURS for that.

In fact it is already there: In case the macro isn't able to find the
browser executable it uses the "start" technique as fallback to open
the file in the browser.

I'll have to think about that...
(The OPENCURS macro seems to be an easy one but required much testing
and much more time, really!)


Christian

 


Topic: Re: Extending opencurs.vdm (4 of 8), Read 40 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Friday, May 12, 2006 10:20 PM

At 05:55 PM 5/12/2006, you wrote:
>It should be no problem to modify/enhance/duplicate OPENCURS for that.

OK. However, it should be a separate function in the {FILE, Open more} menu to distinguish between opening the (any) file in VEDIT and opening it in the default program.

We can use opencurs.vdm, but need to invoke it with a different option then.

Here are some quick thoughts for the actual menu name:

Start file at cursor
Run file at cursor
Open file at cursor in app

Ted.

 


Topic: Re: Extending opencurs.vdm (3 of 8), Read 35 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Friday, May 12, 2006 10:14 PM

At 04:54 PM 5/12/2006, you wrote:
>It occurs to me to wonder if anyone has written something similar but extending the method to open other sorts of files using the same technique. For example it would be great if browsing a list in Vedit, I could "open" say a .JPG file, or a .PDF file, using the default application.

I'm sure there are details to handle, but the basic way to open a file with the default application is to shell out with a "start filename.ext" where 'filename.ext' is the name of the file.

Ted.

 


Topic: Re: Extending opencurs.vdm (5 of 8), Read 35 times
Conf: Keyboard, keystroke macros
From: Ian Davies
Date: Sunday, May 14, 2006 09:21 PM

The suggestions here are very helpful and I will attempt to work something out along these lines.

At the moment I have another curious problem. Periodically and for reasons unknown, I cannot shell out from within Vedit. Attempting to do so brings the error message:

CANNOT SHELL OUT. ERROR #2

I have attempted to find out what error #2 is, but so far without success. If I can restore the shell out functionality, there's a good chance I can also achieve the "open other applications".

Ian.

 


Topic: Re: Extending opencurs.vdm (6 of 8), Read 35 times
Conf: Keyboard, keystroke macros
From: Ted Green
Date: Monday, May 15, 2006 09:44 AM

At 09:22 PM 5/14/2006, you wrote:
>At the moment I have another curious problem. Periodically and for reasons unknown, I cannot shell out from within Vedit. Attempting to do so brings the error message:
>
>CANNOT SHELL OUT. ERROR #2
>
>I have attempted to find out what error #2 is, but so far without success. If I can restore the shell out functionality, there's a good chance I can also achieve the "open other applications".

We simply return the error code returned by Windows/cmd.exe.
I have not looked for a list of these error codes.
(Sorry to give such a bad answer.)

Ted.

 


Topic: Re: Extending opencurs.vdm (7 of 8), Read 36 times
Conf: Keyboard, keystroke macros
From: Ian Binnie
Date: Monday, May 15, 2006 08:19 PM

On 5/15/2006 9:44:12 AM, Ted Green wrote:
>At 09:22 PM 5/14/2006, you
>wrote:
>>At the moment I have another curious problem. Periodically and for reasons unknown, I cannot shell out from within Vedit. Attempting to do so brings the error message:
>>
>>CANNOT SHELL OUT. ERROR #2
>>
>>I have attempted to find out what error #2 is, but so far without success. If I can restore the shell out functionality, there's a good chance I can also achieve the "open other applications".
>
>We simply return the error
>code returned by
>Windows/cmd.exe.
>I have not looked for a list
>of these error codes.
>(Sorry to give such a bad
>answer.)
>
>Ted.
>

Code Description Name
2 The system cannot find the file specified. ERROR_FILE_NOT_FOUND

 


Topic: Re: Extending opencurs.vdm (8 of 8), Read 34 times
Conf: Keyboard, keystroke macros
From: Ian Davies
Date: Wednesday, May 24, 2006 06:31 PM

>Code Description Name
>2 The system cannot find the file specified. >ERROR_FILE_NOT_FOUND

Many thanks for your help. I now have a starting point to tackle the problem.

Ian