Jump to content

Shortcut opens autoit script, then calls a file


 Share

Recommended Posts

Hi All,

I think I have an easy question that I have not been able to find an answer to. We have a program (VisualCadd) that when opened, needs several commands run. I have compiled the script for this and it works well. I switched the shortcut to the normal executable (vcadd5.exe) to call my autoit script. My script opens the VisualCadd program and runs the commands.

The problem I have is when a user clicks directly on a .vcd file (VisualCadd file extension). The file will open in VisualCadd, but my script does not run and therefore the settings in the VisualCadd program are incorrect.

I want to have all .vcd files associated with my program. Then when the users run a .vcd file, it will call my program, open VisualCadd, open their file, and run the commands to fix the zoom. I need help getting the filename that the user clicks. If I can get this, I can open the files in VisualCadd and then run my program to fix the VisualCadd settings.

My code is very simple for opening the VisualCadd program:

CODE
$vcaddfile = '"' & @ProgramFilesDir & '\TriTools Partners\Visual CADD 5\Programs\vcadd5.exe" '

run ($vcaddfile)

sleep(10000)

send("ZU")

sleep(50)

send("0.083")

send("{Enter}")

$verpos = @DesktopWidth /2

$horpos = @DesktopHeight /2

mouseclick("left",$verpos,$horpos)

Thanks in advance

Link to comment
Share on other sites

Well, in that case you need to edit the registry settings for the filetype.

Hi, Yes, I already edited the registry settings for the filetype. I can click on a .vcd file and call my autoit executable. The problem is that I don't know how to code into my autoit executable to get the filename that called it.

i.e. if a user clicks their file "c:\saved files\my file.vcd", it will call my autoit program, the vcd filetype points to my program. How do I have my program then open their "my file.vcd" given that the name "my file.vcd" will change depending on the user. I need to have the program grab the filename that called it.

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...