RobRod Posted February 6, 2014 Share Posted February 6, 2014 Hello there, I use this code to save a screenshot: _ScreenCapture_CaptureWnd(@ScriptDir & "\blubb.jpg", $hWnd) I execute my script from different directories by shortcuts. Of course the screenshots always saves to the folder where my *.exe is located. For example, if my script is "c:autoitscript.exe" and I place a shortcut to this executable on my desktop, the screenshot will still be saved to c:autoit - and not on the desktop. Is there something like @ShortcutDir or how to manage this? Link to comment Share on other sites More sharing options...
Nikolle9203 Posted February 6, 2014 Share Posted February 6, 2014 Try with this func " FileGetShortName" $path=FileGetShortName(@ScriptDir & "blubb.jpg") _ScreenCapture_CaptureWnd($path, $hWnd) Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 6, 2014 Share Posted February 6, 2014 So you want the screenshot file to be put in the directory from where it's calling shortcut is located, and not in the directory where the script (no matter whether it's compiled or not) is located? Replace the @ScriptDir macro with the @WorkingDir macro. Actually, I don't know for sure that that will work. Well, I know the ScriptDir macro needs to be replaced, but I'm not entirely sure it's the WorkingDir one. See the Help file (in the Macros category) for all. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
RobRod Posted February 19, 2014 Author Share Posted February 19, 2014 @Nikolle: the result is exactly the same. It gives the path where the .exe is located, not from where it is called from (the shortcut). @somdcomputerguy: tried this already, also read the help file. Looks like there is nothing that works right now (or more programming is needed). I just use a directory select dialog for now. Thank you both. 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