Execute active file based on file extension

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)

Execute active file based on file extension

Postby higuita81 » Tue Dec 18, 2007 4:57 pm

Is there a macro command like this: rundos fileName ???

Because I don't want to configure always a user tool.

tnx
User avatar
higuita81
Newbie
 
Posts: 2
Joined: Fri Dec 14, 2007 12:00 am

Re: Syntax highlighting for dos command output

Postby Mofi » Tue Dec 18, 2007 5:13 pm

From within a macro or script you cannot run executables directly. That would be a high security risk - see Microsoft with ActiveX and Visual Basic Scripts. You must define a user tool or project user tool with the command and its parameters if you want to run it from within a macro or script.

You have hopefully read the help about the user tool configuration because there are some variables which you can specify on the command line of the user tool.

Well using a user tool with the command line start %sel% would allow you to run everything from within a macro if the macro creates and selects the rest of the command line.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Execute active file based on file extension

Postby higuita81 » Wed Dec 19, 2007 10:21 am

thank you
User avatar
higuita81
Newbie
 
Posts: 2
Joined: Fri Dec 14, 2007 12:00 am

Re: Execute active file based on file extension

Postby sarnold_688 » Wed Dec 26, 2007 8:23 pm

I set up a TOOLBAR CONFIG on F5 that runs super and is simple.
Its "Run by Extension".
It just runs the file or whatever based on its association.
For example, outside of UE and opened a DOSBOX and typed my filename, like, "index.html", IE opens it.

Here's my setting for doing this in UE Config:
Menu Item Name: Run By EXT
Command Line: cmd /c "%f"
Working Dir: %P

OPTIONS:
Program Type: DOS
Save Active file: checked (not required, but a good thing since you ARE going to run that file)

OUTPUT:
Command Output
[x] Output To ListBox
[x] Capture Output

Replace Text:
[x] No

Now this works with any file you have as it is associated as the WINDOWS DEFAULT. If you like to "compile" as a DEFAULT, then change the WINDOWS assoc for it.
Keep in mind that when you are in explorer and double click, the NEW default is used, eg, it will compile and not open it in UE )or however it was set.

For me, UE is pretty much my DESKTOP replacement 8) and I've set it so that I do everything in there.
Example:
In UE FileTree, I may see a file "hompage.jpg".
I'll double click(opening it in UE).
It shows BINARY (ugh!) , but so what! I want to see it!
So I hit my F5(shortcut to "Run By Extenson").
BOOM! Up comes the MS Image Viewer showing the file.
So, I do not like that. I re-asoc'd it to PAINT.
Hit F5 again, and now its in PAINT.

Good luck with this tip.
User avatar
sarnold_688
Newbie
 
Posts: 4
Joined: Thu Nov 01, 2007 11:00 pm


Return to Custom User Tools/Tool Configuration