I want to assign to a keystroke the following to create a new file:
1. Prompt for a filename -- which I think is done with the ? param
2. Create the file -- maybe something like nul > name ?
3. Move the cursor to that filename but without selecting it -- ???
I know I could maybe send keys from AHK, but it seemed like I could do this with native commands. I was trying to write an em_ command for it. I saw LoadSelectionFromClip in other forum threads, but there were two issues. First, I don't really want to select it, but instead just move the cursor to it. Second, I'm not even sure how the response to the ? parameter to a custom command would get into the Clipboard with native commands.
I'm sure I'm missing the easy solution here. Is there a good way to do this with native commands? Many thanks.
[Solved] Create new file and move cursor to it?
Moderators: Hacker, petermad, Stefan2, white
[Solved] Create new file and move cursor to it?
Last edited by sirksel on 2024-06-16, 12:46 UTC, edited 1 time in total.
Re: Create new file and move cursor to it?
Try Shift+F4 (that's cm_Edit to create a new file on default setup)
More solutions can be found by googling "create new file site:www.ghisler.ch"
For more help just asks.
More solutions can be found by googling "create new file site:www.ghisler.ch"
For more help just asks.
Re: Create new file and move cursor to it?
2sirksel
Example: cm_Edit /CGL0N="<[P].txt" (or)
PS: By the way, you didn't answer me in the thread.
Example: cm_Edit /CGL0N="<[P].txt" (or)
PS: By the way, you didn't answer me in the thread.
Overquoting is evil! 👎
Re: Create new file and move cursor to it?
2Stefan2
Thanks for your suggestion. I tried cm_Edit, which isn't Shift+F4 in my custom mappings, but it still wanted to open the file.
I liked your idea to find ghisler.ch matches, and found some for the cm_Edit parameters, which I figured must exist, based on Fla$her's answer.
2Fla$her
Thanks for your hints and links! So I followed your lead, and ended up using:
cmd=cm_Edit /CL0
I wanted it to prompt me for a name, go to the name, but not open it. L0 seemed to be the magic I didn't know existed.
P.S. Also, I answered you on the other thread, but I'm still trying to figure a good way to test your button bar. Sorry for my delay!
Thanks for your suggestion. I tried cm_Edit, which isn't Shift+F4 in my custom mappings, but it still wanted to open the file.
I liked your idea to find ghisler.ch matches, and found some for the cm_Edit parameters, which I figured must exist, based on Fla$her's answer.
2Fla$her
Thanks for your hints and links! So I followed your lead, and ended up using:
cmd=cm_Edit /CL0
I wanted it to prompt me for a name, go to the name, but not open it. L0 seemed to be the magic I didn't know existed.
P.S. Also, I answered you on the other thread, but I'm still trying to figure a good way to test your button bar. Sorry for my delay!
Re: Create new file and move cursor to it?
2sirksel
So you're satisfied now? Do it works for you as you wanted it?
So you're satisfied now? Do it works for you as you wanted it?
Re: Create new file and move cursor to it?
Yes, it works great. I'm not sure if there's a way I'm supposed to mark it as closed? I don't see the "accepted answer" button I see on some forum sites. Anyhow, thank you all so much.
Re: Create new file and move cursor to it?
No, nothing is closed on this forum so no action is necessarysirksel wrote: 2024-06-16, 02:17 UTC I'm not sure if there's a way I'm supposed to mark it as closed?

If you wish, you can edit your first post and edit the subject (and add "[Solved]" for example). This will change the thread's title.