Phaisius Posted March 9, 2014 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
Driveskull Posted March 9, 2014 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
Phaisius Posted March 9, 2014 Author 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?
orbs Posted March 9, 2014 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 WinPose - simultaneous fluent move and resize 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 Magic Math - a math puzzle Demos: Title Bar Menu - click the window title to pop-up a menu
Phaisius Posted March 9, 2014 Author Posted March 9, 2014 ok Thank you for your help I got it working
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