cozza Posted March 17, 2018 Posted March 17, 2018 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.
Nunos Posted March 17, 2018 Posted March 17, 2018 (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 March 17, 2018 by Nunos Forgot a link
orbs Posted March 17, 2018 Posted March 17, 2018 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). Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
cozza Posted March 18, 2018 Author Posted March 18, 2018 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.
orbs Posted March 18, 2018 Posted March 18, 2018 (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 March 18, 2018 by orbs Xandy and Bilgus 2 Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now