Use of Editor with DO

Goodevening from Holland,

Perhaps a question which is already asked but I can't find it (or I'm too lazy to search for it -;):

I'm very often using an editor, let's say UltraEdit.

I would like to create a button (that's easy) with a shortcut (e.g. F4) that behaves as follows:

  • select a file, press F4: UltraEdit launches and loads the selected file (that button allready excists)
  • if I click the button: launch UltraEdit WITHOUT loading a file; even if one is selected (I would like to make a new textfile).

I don't get it so far. The button and F4 and loading a file: no problem, they work as expected. But clicking the button: it allways loads the selected file.
Or do I have to create TWO buttons?

Thanks in advance,

Regards,

Rien

So you want a button which sometimes loads the selected file into UltraEdit, and sometimes ignores the selected file and just opens UltraEdit?

If so: When a file is selected, how should the button know which of the two actions you want to perform?

Or do you mean something else? e.g. Opening a file if one is selected, and creating a new file (or just running the program without any file) when no file is selected?

Hello Leo,

I don't know if the button can determine that I clicked the button or that I pressed F4. After a click I would like to launch the editor without the selected file and with F4 I would like to load the editor with the selected file. But I don't know if the button can do this. Otherwise I have to create two buttons: 1 with F4 and 1 without. Can a button be made invisble?

Thanks mate.

Or is there a modifier (shift, ctrl...) with a click to ignore the {filepart} part?

I understand now. Thanks for the details.

The easiest thing is to make a button without a hotkey to do what you want the button to do, then create a standalone hotkey (via Settings > Customize Toolbars > Keys) which does what you want F4 to do.

You could also have a single button with F4 hotkey which does both, and make it run a script which checks if the mouse button was used to run it, but it would more effort.

Thanks Leo!

I will try the first suggestion; create a standalone hotkey.

I'm confused. I use NoteTab Pro as my text editor, and I've defined a DOpus button with

"C:\Program Files (x86)\NoteTab Pro 6\NotePro.exe" {filepath}

as the underlying command. It works like you desire; that is, if a file is selected, NoteTab opens on that file, but if no file is selected then NoteTab just opens in its current or most recent state.

In case any of the following is relevant:

NoteTab uses a tabbed interface, and I have its prefs set to allow only one instance of itself, and so if I already have NoteTab open then when I click on that DOpus button window focus simply jumps to the already-open NoteTab, but if NoteTab is not already open, then clicking on that Dopus button just loads NoteTab (which has the files open on its tabs that I had loaded into it when I last closed it down, optionally along with the file, if any, that I had selected in DOpus. (And if I did have a file selected in DOpus, but it's already loaded into NoteTab, then NoteTab's own focus simply jumps to the tab the already-loaded selected file is under.)

This of course raises the question: What's the difference between the design of UltraEdit and that of NoteTab that makes a button like mine behave exactly as you desire for my NoteTab but not for your UltraEdit?

[quote]I'm confused. I use NoteTab Pro as my text editor, and I've defined a DOpus button with

"C:\Program Files (x86)\NoteTab Pro 6\NotePro.exe" {filepath}

as the underlying command. It works like you desire; that is, if a file is selected, NoteTab opens on that file, but if no file is selected then NoteTab just opens in its current or most recent state. [/quote]
That's not what he was asking for. He wants a way to open the editor and make it ignore the file selection even if something is currently selected.

Leo grumbled:

Ah, hence my confusion: I misinterpreted what he was asking for. (That'll teach me to not mind my own business. :wink:

Yes, in that case, exactly as you said, Leo:

May I also suggest as an alternative, assuming there's no unhealthy love affair with keyboard presses for their own sake, to make a button that handles both functions, one under a left-click and the other under a right-click?