Script to save the present file

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
aca
Posts: 22
Joined: 03 Dec 2016, 09:33

Script to save the present file

24 Jun 2021, 10:05

I want a script that will save twice the file I am working on; any type of file, for instance, "Presentfile.pdf".
First on my hard drive, say, in a folder I’ve named “ACCOUNTING”; that is, a command for
- save to C:\Users\Name\Documents\ACCOUNTING\Presentfile.pdf
And then on a USB pen drive (which already contains a folder by the same name “ACCOUNTING”); I mean, a command that will capture the folder and file names from the previous command (\ACCOUNTING\Presentfile.pdf) and then save that to my pen drive (E:); that is,
- save to E:\ACCOUNTING\Presentfile.pdf

What would the syntax for that be, in Auto-HotKey?
Thanks for any help.
aca
User avatar
tidbit
Posts: 1272
Joined: 29 Sep 2013, 17:15
Location: USA

Re: Script to save the present file

24 Jun 2021, 16:06

1) wrong section. Moving. Scripting is not for requests but stuff you have already made.
2) there would be no universal way to do this. All programs handle saving differently. unless the full filepath is in the titlebar, there would be no way for ahk to know what file you have open in what program. Especially if it has multiple tabs and a non-standard UI.

if you do know the filepath of the file just saved, you'd use a filecopy to make a copy in a different location, assuming you have permissions
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
aca
Posts: 22
Joined: 03 Dec 2016, 09:33

Re: Script to save the present file

25 Jun 2021, 02:35

Thank yo, titbit, for your replying: for moving my question to "Ask for Help"; I didn't know I posted it on the wrong one.
Also for your tips about my issue. Thanks.
aa

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Thorlian and 268 guests