Dryden Posted October 16, 2008 Share Posted October 16, 2008 Hi! I'm trying to make a script that when compiled it does certain operations to each file that is dragged to it. Can you guys help me? To keep it simple, lets suppose that i wanted a script that runs the filer dragged into it with "Run()" for example. thx in advance. "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett. Link to comment Share on other sites More sharing options...
Bert Posted October 16, 2008 Share Posted October 16, 2008 http://www.autoitscript.com/forum/index.ph...p;hl=drag++drophttp://www.autoitscript.com/forum/index.ph...p;hl=drag++drophttp://www.autoitscript.com/forum/index.ph...%2Bdrag+%2Bdrop The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
trancexx Posted October 16, 2008 Share Posted October 16, 2008 (edited) http://www.autoitscript.com/forum/index.ph...p;hl=drag++drophttp://www.autoitscript.com/forum/index.ph...p;hl=drag++drophttp://www.autoitscript.com/forum/index.ph...%2Bdrag+%2BdropI don't think Dryden meant that (but I could be wrong ). It would be too obvious.@Dryden;I posted an example for monocereses "DEE - Dll Exports Viewer". Check here.Application is initialized by dropping files onto it (it process that file). Edited October 16, 2008 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Dryden Posted October 16, 2008 Author Share Posted October 16, 2008 What I want is to have my script compiled in .exe ant without executing it drag & drop a file into it and the script opens it. "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett. Link to comment Share on other sites More sharing options...
martin Posted October 16, 2008 Share Posted October 16, 2008 What I want is to have my script compiled in .exe ant without executing it drag & drop a file into it and the script opens it.Trancexx gave an example but here is a description of what to do. First you need to understand that when you drop a file onto an executable that Windows simply runs the executable with the file name as a parameter. So you just need to be able to deal with a parameter in your script. Read the section in the help about "running scripts" and understand what it says about parameters, $CmdLine[0] etc. In your script you must check somewhere near the start if there are any parameters passed. Is $CmdLine[0] > 0? If $cmdLine[0] is greater than 0 then the first paranmeter is $CmdLine[1] which in your case will be the name of the file dropped onto the exe. You can test how a script deals with parameters without having to compile it if you use SciTE. The parameters are set in the view menu. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Dryden Posted October 16, 2008 Author Share Posted October 16, 2008 that was exactly what I was looking for $CmdLine[1] thx m8 "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett. Link to comment Share on other sites More sharing options...
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