If the first line of a text file is Growing Oranges is there a way for UltraEdit to automatically save it that way when saving the text file without having to type in the name when the Save dialog pops up?
And I really hate this MS Word mechanism because it produces many files with not really useful file names which make problems later, although the mechanism itself is not the problem. The real problem are the users who are too lazy to type in a decent file name (without spaces) because they are not forced to enter a decent file name.
Well, you can use an automatically loaded macro with an appropriate hotkey assignment to save new files with the first line as file name. An example macro code for this job:
IfNameIs ""
InsertMode
ColumnModeOff
HexOff
Top
Key END
IfColNumGt 1
".txt"
Clipboard 9
StartSelect
Key HOME
Copy
EndSelect
Key END
Key BACKSPACE
Key BACKSPACE
Key BACKSPACE
Key BACKSPACE
SaveAs "^c"
ClearClipboard
Clipboard 0
Else
SaveAs ""
EndIf
EndIf
It has some disadvantages:
The cursor is at end of the first line after execution. So you must use "Go to last position" to bring the cursor back to the position before save.
The file extension is fixed and you cannot modify the path. It will always save the file with the extension in the macro to current working directory whatever the current working directory is.
And it's not possible to change the line terminator or the file format before save as it is possible with the Save As command.
It's not possible to open the Save As dialog with the copied first line pasted into the File Name field.
Well, you can modify the macro above to copy the first line to windows clipboard (Clipboard 0) and just open the Save As dialog (SaveAs "") and you manually press Ctrl+V to insert the "file name".
Hi Bego!
I have seen your post after submitting my post. Your macro will not work for files where first line is an empty line.
Best regards from an UC/UE/UES for Windows user from Austria