get file name in text

Help with writing and playing macros

get file name in text

Postby mightymax » Thu Oct 14, 2004 8:33 am

Does anyone know how I would insert the name of the file I'm working on into the text file?


Thanks, Max
User avatar
mightymax
Basic User
Basic User
 
Posts: 30
Joined: Tue Jul 27, 2004 11:00 pm
Location: San Diego, CA

Re: get file name in text

Postby Mofi » Thu Oct 14, 2004 10:44 am

In the Edit menu click on Copy File Path/Name. Paste it where you want with Ctrl+V and remove the path.

Second method is to create a template named "File name" with the template definition [FILE_NAME] oder [FULL_FILE_NAME] and assign a hotkey to this template. See help of UltraEdit about Templates.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: get file name in text

Postby mightymax » Thu Oct 14, 2004 2:24 pm

My text files are already written is there any way to bring this function into a script?

Top
CopyFilePath
Find RegExp "href=__"
Paste

:?:

Thanks, Max
User avatar
mightymax
Basic User
Basic User
 
Posts: 30
Joined: Tue Jul 27, 2004 11:00 pm
Location: San Diego, CA

Re: get file name in text

Postby Mofi » Fri Oct 15, 2004 3:17 am

What about

InsertMode
ColumnModeOff
HexOff
UnixReOff
Top
CopyFilePath
Find RegExp "href=__"
Replace All "href=^c"

This would do the job, but the references are not valid html references, although Internet Explorer would execute it.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: get file name in text

Postby mightymax » Fri Oct 15, 2004 9:18 am

Thank you, I was able to come up with something similar.

Top
Loop
CopyFilePath
Find "__"
IfNotFound
ExitLoop
EndIf
Paste
EndLoop
User avatar
mightymax
Basic User
Basic User
 
Posts: 30
Joined: Tue Jul 27, 2004 11:00 pm
Location: San Diego, CA

Re: get file name in text

Postby TontonFlingueur » Wed Nov 17, 2004 7:05 pm

Mofi wrote:In the Edit menu click on Copy File Path/Name. Paste it where you want with Ctrl+V and remove the path.


How can you remove the path with a macro? Or may be it exist a copy file name without path and extension ?
Of course the path i want to remove is not the same for all files !

Can you help me ? My knowledge in UE macro language is as week as my english... i think i can understand but write it :cry:

Thanks,

Jean-Marc
User avatar
TontonFlingueur
Newbie
 
Posts: 2
Joined: Wed Nov 17, 2004 12:00 am

Re: get file name in text

Postby mightymax » Mon Nov 22, 2004 5:05 pm

Could you post a couple of examples?
User avatar
mightymax
Basic User
Basic User
 
Posts: 30
Joined: Tue Jul 27, 2004 11:00 pm
Location: San Diego, CA

Re: get file name in text

Postby Mofi » Tue Nov 23, 2004 2:16 am

Hello Jean-Marc!

If you only need the filename without extension, do not use the CopyFilePath command. Use instead a template.

Open Advanced - Display/Modify Templates.

At the dropdown list at the bottom of the dialog select a not used template number. 0- is default, if you don't have any templates. Enter a template name at top of the dialog, for example "Insert filename". And in the big edit area enter only [FILE_NAME].

You can now use the template manually via the menu, the template list, the toolbar or a hotkey or use it in a macro with the command Template 0. 0 is just an example for the template number. If "Insert filename" is assigned to template 6, use Template 6.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: get file name in text

Postby TontonFlingueur » Wed Nov 24, 2004 2:16 pm

Thanks for your reply. I will try to use a template.

kenavo from Brittany

Jean-Marc
User avatar
TontonFlingueur
Newbie
 
Posts: 2
Joined: Wed Nov 17, 2004 12:00 am


Return to Macros