Jump to content
cozza

Possible to send files to autoit via send to menu?

Recommended Posts

cozza

Hi, I run this command on files all the time

atomicparsley.exe "FILE.EXT" --comment "TEXT" -W

but it's a pain doing it via the command line all the time. It would be much better to have an autoit script in the Send To context menu so I can highlight one or more files and send them to a script that will run that command on each of them. Is this possible? If so any help would be appreciated.

Thanks.

Share this post


Link to post
Share on other sites
Nunos
Posted (edited)

Not sure about adding it to the Send To menu per sey but a thought might be to make your script into a function and then assign it to a HotKey so you can press that key combo to run your function.

Below is the link for documentation on creating your own Function.

https://www.autoitscript.com/autoit3/docs/keywords/Func.htm

AND...

Below is the documentation for setting HotKey's.

https://www.autoitscript.com/autoit3/docs/functions/HotKeySet.htm

 

Edited by Nunos
Forgot a link

Share this post


Link to post
Share on other sites
orbs

hello @cozza, and welcome to AutoIt forum.

instead of using the "Send To" function, which is not adequate for such purpose, you want to create a new context menu item, to trigger your AutoIt script, which can ask you for the "TEXT" string and apply it to the selected file(s). i assume the "TEXT" string varies between files (or batches of files).

registering a context menu item is not an AutoIt-specific operation; you can get that info anywhere on the web. you can do that for all files, specific file types, folders, etc.

your AutoIt script needs to follow this logic:

1) be launched with a file name as the command line argument.

2) if there is already an instance of your script running, append that file to the list handled by the existing instance, and terminate.

3) ask the user to input a comment.

4) call atomicparsley.exe for the listed file(s).

 

 

 

Share this post


Link to post
Share on other sites
cozza

Years ago I had a script that sat in the send to folder and would execute commands on the files sent to it. It worked via the drag and drop function IIRC. Swear I still have it somewhere but not found it yet.

Thanks for the advise I'll look into your options as well.

Share this post


Link to post
Share on other sites
orbs
Posted (edited)

if you insist on using the "Send to" feature, then first write your script to accept the file name as the command line argument - in AutoIt, that would be $CmdLine[1]. look it up in the help file: AutoIt \ Using AutoIt \ Command Line Parameters.

then, compile your script and place the executable in the "SendTo" folder, either for your user profile only or for all users. see here on how to locate and customize the "SendTo" folder.

once this is working for a single file, enhance your script to accommodate for multiple files and folders.

Edited by orbs
  • Like 2

Share this post


Link to post
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

×