Samuel25 Posted April 1, 2014 Share Posted April 1, 2014 Hi, I'm very new using Au3 and I've find my first obstacle When I joined here: http://www.autoitscript.com/autoit3/docs/libfunctions/_ScreenCapture_Capture.htm I found quite easy to use this, so I copied the example from below: #include <ScreenCapture.au3> _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg") This saved a screenshot into MyDocuments. Now, I've tried to change the directory but then doesn't work. This is what I've done: #include <ScreenCapture.au3> Global $name $name = 1 _ScreenCapture_Capture(@ScriptDir & "\Test\" & $name & ".jpg") Can anybody tell me what's wrong there? Link to comment Share on other sites More sharing options...
UEZ Posted April 1, 2014 Share Posted April 1, 2014 Folder "Test" probably doesn't exist. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 1, 2014 Moderators Share Posted April 1, 2014 (edited) It works fine for me. Is the directory created? _ScreenCapture will not create it Edit: Dang, too slow Edited April 1, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Samuel25 Posted April 1, 2014 Author Share Posted April 1, 2014 Folder "Test" probably doesn't exist. Br, UEZ Yes, I created it. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 1, 2014 Moderators Share Posted April 1, 2014 Where is @ScriptDir pointing? Is it somewhere you have access to create a file? What if you take the variable out of the mix and type the full path out? _ScreenCapture_Capture(@ScriptDir & "\Test\1.jpg") "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
UEZ Posted April 1, 2014 Share Posted April 1, 2014 Where did you created it? Where the script is located? Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Samuel25 Posted April 1, 2014 Author Share Posted April 1, 2014 Ok, I've found why. Sry I'm very new to this. I creted the script in the folder "Examples", from the Autoit folder, and it looks like I don' have the rights to save anythign there. I created it in another folder new created by me and it works. Sorry for my noobiness! Link to comment Share on other sites More sharing options...
UEZ Posted April 1, 2014 Share Posted April 1, 2014 You can do something like this here to debug your code: #include <ScreenCapture.au3> Global $name $name = 1 $path = @ScriptDir & "\Test\" & $name & ".jpg" ConsoleWrite($path & @LF) _ScreenCapture_Capture($path) ConsoleWrite(@error & @LF) Just check out the console output in SciTE! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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