Open in xyz.exe

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
olee
Posts: 4
Joined: 24 Feb 2018, 04:04

Open in xyz.exe

24 Feb 2018, 05:13

Hi there,

one newbie question. :)

I have a little script to open psd files.

But the files should not be opened with Photoshop by default.

In the script there is the line


Gui, Add, Button, gopendwg default, OPEN


How can I tell the script to open the File with another program per example with the path C:/Programs/XYZ.exe ?

Maybe someone can help me.

Kind regards

Olli
gregster
Posts: 8989
Joined: 30 Sep 2013, 06:48

Re: Open in xyz.exe

24 Feb 2018, 05:36

If the program in question accepts files as command line parameters (which should be the case for most graphics software), something like this should work:

Code: Select all

run, C:/Programs/XYZ.exe C:/files/abc.psd
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Open in xyz.exe

24 Feb 2018, 13:04

[brainfart] OR ... you could change the files file extension assignment in the registry on the fly [/brainfart]
olee
Posts: 4
Joined: 24 Feb 2018, 04:04

Re: Open in xyz.exe

28 Feb 2018, 14:56

Hello again,
here is the complete script:
the arx4 Files should be opened by another program than default.

Code: Select all

SetTitleMatchMode 2
Gui, Add, Edit , w200 varx4name, 
Gui, Add, Button, gopenarx4 default , OPEN
Gui, show ,, BEANIES			;give name to gui for later reference
Gui +Resize +MinSize240x150
Gui, Show, x0 y300 NoActivate

return

openarx4:
Gui,Submit,Nohide

IfExist, C:\FILES\PRINT\%arx4name%*.arx4
{
Loop, C:\FILES\PRINT\%arx4name%*.arx4
          Run %A_LoopFileFullPath%
      WinActivate
}

else
{

    MsgBox --> No Data :-( <--
}

Guicontrol,,arx4name,			;makes the edit box blank
return

I did not get it working with this one

run, C:/Programs/XYZ.exe C:/files/abc.psd


I don´t know where to put it in.


This one did not help me out because I have more than one of these scripts. In the one script there are PDF Files that should be opened in Photoshop.
An in the other script the PDF Files have to be opened with Acrobat...

[brainfart] OR ... you could change the files file extension assignment in the registry on the fly [/brainfart]


Maybe someone has an idea ?

Kind regards
Olli
gregster
Posts: 8989
Joined: 30 Sep 2013, 06:48

Re: Open in xyz.exe

28 Feb 2018, 15:33

I did not get it working with this one

run, C:/Programs/XYZ.exe C:/files/abc.psd

I don´t know where to put it in.
If you have different scripts, just use different programs in these scripts to run the different files.

I would replace your line Run %A_LoopFileFullPath% (which opens the file with the default application) with the line above. Replace XYZ.exe with the name of the program that should open the abc.psd (or whatever) file: run program file --> run program %A_LoopFileFullPath% Once you can use the path to Photoshop, once the path to Acrobat as program.
olee
Posts: 4
Joined: 24 Feb 2018, 04:04

Re: Open in xyz.exe

01 Mar 2018, 06:08

Hi #gregster,

Thank you !! :dance:
That worked !

One more question , have you got an idea how I tell the the tool, that I have to write at least 4 letters in the textsearch field, otherwise it would not execute ?
Odlanir
Posts: 659
Joined: 20 Oct 2016, 08:20

Re: Open in xyz.exe

01 Mar 2018, 06:31

Code: Select all

openarx4:
Gui,Submit,Nohide
if (StrLen(arx4name) < 4 )
   return
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
olee
Posts: 4
Joined: 24 Feb 2018, 04:04

Re: Open in xyz.exe

01 Mar 2018, 06:54

Great !! Thank you Odlanir,

have you got an Idea how to close a specific program after the script has done its job?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], haomingchen1998, mikeyww and 248 guests