cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Translate the entire conversation x

Mapkey to open an app in working directory

RaphMORIN
16-Pearl

Mapkey to open an app in working directory

Hello all,

 

I have a mapkey (ex) that opens the windows explorer in the working directory. I have recently switched to directory opus as an alternative explorer. I would like to make a macro that launches directory opus in the working directory. Do you know how I could achieve that ? How would you do ?

Thanks.

ACCEPTED SOLUTION

Accepted Solutions

Thanks all for your help.

 

Finally I made it using Autohotkey. The only thing, I had to add a few pause in the script (Sleep command) because the script was too fast to copy the working directory. Sometimes it was working, sometimes not. Now it works 100%. 😁

 

I had never used Autohotkey before, it's quite easy to learn. 

 

Here's the script if anyone is interested.

 

!e:: ; Raccourci ALT+E
Send {Alt}
Send f
Send m
Send w
Send {Tab}
Send {Tab}
Sleep 100
Send {Space}
Sleep 100
Send ^c
Sleep 100
Send {Esc}
Run, dopus.exe "%Clipboard%"
return

 

View solution in original post

6 REPLIES 6

Thanks for the tip. I'm just wondering how I could pass the working directory as argument to my command line ?

 

RaphMORIN_0-1770300891224.png

 

remy
21-Topaz I
(To:RaphMORIN)

If you refer to this Directory Opus, you might as well request assistance to them directly.
I know that Direct Folders from Code Sector enables to switch browse automatically like :

  1. Open a directory in Windows Explorer 
  2. Leave Explorer open
  3. Then switch to Creo or any other application, when File > Open, the explorer lands on the above directory directly 

 The workflow is a little different but it saves lots of clicks.

Chris3
21-Topaz I
(To:RaphMORIN)

There may be an easier way to do this, but this way would work:

 

1. You have a mapkey that calls File-> Help -> System information -> System information

2. In the message window it will display the path of your working directory along with the file support.inf.1

3. You mapkey opens the message log (Tools -> Message Log) and then saves that message log file to a text file with a known file path.

3. You mapkey calls a vbs file that opens the message log file in step 3 above and extracts the working directory path from the message log and then hands that path off to your other program to open.

I gave a PTC/User presentation that walks through some of these steps here:
https://community.ptc.com/sejnu66972/attachments/sejnu66972/customization/13797/1/VG-4052%20Dynamic%20Mapkeys%20to%20Automate%20Creo%202024-01-23.pdf 

This may help you. When you use "Open System Window" to open a command prompt in the current session it always opens to the location of the working directory.

 

MikePhillips_0-1770304327797.png

 

Thanks all for your help.

 

Finally I made it using Autohotkey. The only thing, I had to add a few pause in the script (Sleep command) because the script was too fast to copy the working directory. Sometimes it was working, sometimes not. Now it works 100%. 😁

 

I had never used Autohotkey before, it's quite easy to learn. 

 

Here's the script if anyone is interested.

 

!e:: ; Raccourci ALT+E
Send {Alt}
Send f
Send m
Send w
Send {Tab}
Send {Tab}
Sleep 100
Send {Space}
Sleep 100
Send ^c
Sleep 100
Send {Esc}
Run, dopus.exe "%Clipboard%"
return

 

Announcements

Top Tags