[Solved] Tool Properties: run with associated app

Started by Stefan, December 01, 2008, 09:43:21 PM

Previous topic - Next topic

Stefan

Tool Properties: how to run with associated app ?  ;D

For Command i want just to enter something like "run" (or leave it empty at all)
and for Arguments i type %FileName%

Then i suggest to execute %FileName% with by EXTension-related app, as stored in Registry.

Is this possible?


For example i want to start an *.ahk file with AutoHotkey.exe
On one PC AutoHotkey.exe is under "C:\Program Files\..."
on other PC AutoHotkey.exe is under "X:Programme\..."
So if AutoHotkey is correctly installed on an PC, Filetype *.ahk is registred under HKCR
and if i double click an *.ahk-file it is startet with the right application.
That i suggest to do TOOLS too  ;D.... but how to set this up?

---

2.)

While Command field seams to can handle relative path like ..\xy.exe
this doesn't work for Icon field, here relative path ..\xy.exe doesn't work.

---

3.)
[ ] Save All Documents before executing.

does this really save "ALL" open Documents before executing this "one" file?
I guess saving "current" file would be enough because i don't want to save other open docs by mistake ;D
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hello Stefan,

1) It is not obvious, but it is possible ;). Instead of Arguments field, place %FileName% to Command field ;) The same is true for %InteractiveFile% and %MainFilePath%. I could invent better way without adding additional flag or some other type of tool.

2) I could not reproduce this. In my case both are working (and icon is updated). I would not use such relative pathes, because you never know what would be current directory in time when you execute the tool. Check with newer beta, I did some changes with Tool Window. If would be the same i need more detail about scenario. Maybe only in some combibation of actions this does not work and I could not get exactly this combination :)

3) Yes. It saves all. This is standard behaviour when you work with projects or run "main file". In this case ALL documents should be stored. Because they all used for compilation for example. But nevertheless I have replaced in new beta check box to combo, and now there are 3 options: Save Nothing, Save Current Document, Save All Documents.

I would try to publish new beta tonight or tomorrow - depends, if I would fix you crash with Replace All ;)

Best regards,
Alex
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

alex

HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

Quote from: alex on December 03, 2008, 12:32:46 AM
Hello Stefan,

1) It is not obvious, but it is possible ;). Instead of Arguments field, place %FileName% to Command field ;) The same is true for %InteractiveFile% and %MainFilePath%. I could invent better way without adding additional flag or some other type of tool.

Of course, i am stupid. I must have known this on my own.
This maybe only an issue to add this to the help chm.


Quote

2) I could not reproduce this. In my case both are working (and icon is updated). I would not use such relative pathes, because you never know what would be current directory in time when you execute the tool. Check with newer beta, I did some changes with Tool Window. If would be the same i need more detail about scenario. Maybe only in some combibation of actions this does not work and I could not get exactly this combination :)

I have an sub-folder in my HE-folder with an EXE (Autohotkey.exe)
As Command: i have tools\AutoHotkey.exe and this works (Autohotkey.exe will launch)
As Icon: i have tools\AutoHotkey.exe too, but this didn't find the EXE and shows no Icons

And: to be portable one have to use relative paths  ;D


Quote

3) Yes. It saves all. This is standard behaviour when you work with projects or run "main file". In this case ALL documents should be stored. Because they all used for compilation for example. But nevertheless I have replaced in new beta check box to combo, and now there are 3 options: Save Nothing, Save Current Document, Save All Documents.

He! Wonderful ! That's very kind of you.
(Saving current file is enough for me, because i work with single files only (no project) and
so i have several files open....... but only one script to save and execute. So this new option comes very handy, thanks  ;D )
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

QuoteOf course, i am stupid. I must have known this on my own.
This maybe only an issue to add this to the help chm.
Of course not :).
This is really not easy to imagine. I have spent some time to find out how to do it with existing functionality... ;)
Yes I would place this into chm. The help this is at all a pain point - there are a lot of descriptions missing but I have no time to enchance it yet. But would try, step by step.

QuoteI have an sub-folder in my HE-folder with an EXE (Autohotkey.exe)
As Command: i have tools\AutoHotkey.exe and this works (Autohotkey.exe will launch)
In reality relative pathes were not supported as by command as by icons. I have checked this. But from 547 should ;). Check it.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

.547
- where is the "Tools > Manage Tools"-dialog? I didn't find it with .547 ;D
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

It is only visible when you have any document open.
Because tools are syntax specific... For now there are no some generic independent tools.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

> It is only visible when you have any document open.
What was true for me.


I solved it now, ...it was something like that i didn't copy all new .547 files to my install-folder ?!?!

Sorry.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Stefan

Quote from: alex on December 04, 2008, 11:54:22 AM

In reality relative pathes were not supported .... ...But from 547 should ;). Check it.

Sorry, not fully.

Just for the record, no push for 1.4!




1.) the icon is taken from *.EXE written in "Command" field.
Not from *.EXE written in "Icon" field, if the Icon-path is written as relative path.

Yes, this could be two different *.EXEs indeed.

F.ex. try
Command: %systemroot%\system32\calc
Icon: %systemroot%\system32\notepad => only Icon from Calc.exe
Icon: C:\windows\system32\notepad ==> will work, Icon is taken from Notepad.exe.




-------



2.) this in 'blue' color marked path is not expanded
when written as relative path "tools\AutoHotkey.chm"
Arguments: mk:@MSITStore:X:\HippoEDIT\tools\AutoHotkey.chm::/docs/commands/%CurrentWord%.htm

i.e.
This works 
Command: %SystemRoot%\hh.exe
Icon: X:\HippoEDIT\tools\AutoHotkey.exe
Arguments mk:@MSITStore:X:\HippoEDIT\tools\AutoHotkey.chm::/docs/commands/%CurrentWord%.htm


This not:
Command: %SystemRoot%\hh.exe
Icon: tools\AutoHotkey.exe (no Icon taken)
Arguments  mk:@MSITStore:tools\AutoHotkey.chm::/docs/commands/%CurrentWord%.htm  (MsgBox: file not found)



-----------

3.) May i suggest (i think i have already?) some pseudo system vars:

When HippoEDIT runs, this %vars% should be accessible from inside HE:
%HippoEDIT_Path% ==> folder of HippoEDIT.exe

and maybe
%HippoEDIT_Drive% ==> drive where HippoEDIT is started from

So one can use "%HippoEDIT_Path%\TOOLs\sort.exe" for to be portable.
Or "%HippoEDIT_Drive%\BackupFolder\Text"

.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

1) is solved with 1.40.553.
2)  I could not resolve all pathes, specaially this is not done in Arguments field. Because who knows what you would write there, and at all maybe you dont want to be this path resoved but want to have it passed  exactly as typed to tool? But I think you can solve it using option 3).
3) This is done with 553. Check templates suggestions in menues. Added AppDir, AppDrive, AppDataDir.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

> 1) is solved with 1.40.553.

Yes, works great.
Title:          Open Autohotkey Help
Command:   C:\windows\hh.exe
Icon:          tools\AutoHotkey.exe
Arguments:  mk:@MSITStore:%AppDir%\tools\AutoHotkey.chm::/docs/commands/%CurrentWord%.htm


> 2)  I could not resolve all pathes, specaially this is not done in Arguments field.
> Because who knows what you would write there, and at all maybe you dont want to
> be this path resoved but want to have it passed  exactly as typed to tool?
Here you're right.

> But I think you can solve it using option 3).
WOW


> 3) This is done with 553. Check templates suggestions in menues. Added AppDir, AppDrive, AppDataDir.
I am still testing... but at least %AppDir% works.


Well done ;D An great step to be portable.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Stefan

Just a note for later:

Project an File Explorer didn't allow relative paths nether %HEPath%
There is an algorithm which check the path and prevent me to use relative paths.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Sorry, Stefan, I could not get you ;)
Where exactly a problem? Where you have tried %HEPath% (and by the way, what is it - you mean HE directory)?
Files in a project stored with relative path to project file. If it is not relative, then absolute path should be used.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

#13
Quote"Project Exlporer" an "File Explorer" didn't allow to store relative paths as "Favorites", nether %AppDir% works here

I am able to store path relative now. (build 556 from 22.12.2008) Thank you.

But i see an problem we hat with 'settings.xml' too:
If a path is stored as absolute path, but this path is not available, then HE creates this path.

1) i have
"D:\HippoEDIT\data\projects\test.heprj"


2) i move this HE-folder to an another PC to C:\
"C:\HippoEDIT\data\projects\test.heprj"

3) in settings is stored the absolute path "D:\HippoEDIT\data\projects\test.heprj"
Since this path is not available... HE creates it  (asume D:\ exists, ...don't know what happens if D:\ doesn't exists)


I think i's no good bahviour to create folders on it own.
That way we mess up the HDDs and take care of mistakes.

Good practice would be... If an path/folder/file doesn't exists... just grey-out the resource and/or show an MsgBox " %resource% is not available. You may check the path"

What do you think?
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Ok. Now I have understood.
I have just not implemented usage of relative paths and template variables.
But this is not a big deal. I can add it with a beta.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]