Phaisius Posted March 9, 2014 Share Posted March 9, 2014 hey peoples, I am new autoit and i have made a script it all works, Its just there is one thing i would like to change. were i have added my pictures in i have used this: $hPic_background = GUICtrlCreatePic("C:UsersPhaisiusDesktopJaguar.jpg") My question is what code can i use to make it so the picture is getting loaded from the directory of the script so i can put the scipt in a folder and the pictures in a folder in the folder of the script That way i can move the folder and it would still work. Anyone understand were i am coming from? like i said i am learning help would be awsome Thanks, PhaiSiuS Link to comment Share on other sites More sharing options...
Driveskull Posted March 9, 2014 Share Posted March 9, 2014 (@WorkingDir & "Images5.png" Use it like this, when you move a script with a image folder it will always use it Link to comment Share on other sites More sharing options...
Phaisius Posted March 9, 2014 Author Share Posted March 9, 2014 Awsome Thanks heeps mate Link to comment Share on other sites More sharing options...
Phaisius Posted March 9, 2014 Author Share Posted March 9, 2014 i am getting errors in this line i dont think i am putting it in correctly, When you say Workingdir do i have to put the name of the folder that the script is in? $hPic_background = GUICtrlCreatePic(@WorkingDir & "ImagesJaquar.jpg" Thats how i have put it in is that what do you reckon i have done wrong? Link to comment Share on other sites More sharing options...
orbs Posted March 9, 2014 Share Posted March 9, 2014 @WorkingDir is the working directory, not necessarily the directory where the script is located. for the script directory use @ScriptDir in AutoIt, @ is the prefix for an element called "Macro". search the help file for various macros available. 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 Link to comment Share on other sites More sharing options...
Phaisius Posted March 9, 2014 Author Share Posted March 9, 2014 ok Thank you for your help I got it working 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