Jump to content

Include files don't open


Recommended Posts

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;~ #Include "../ScreenCapture/FindBMP.au3"
;~ #Include "../ScreenCapture/ScreenCaptureFixed.au3"
#Include "ScreenCapture/FindBMP.au3"
#Include "ScreenCapture/ScreenCaptureFixed.au3"
Global $aResult = _FindBMP("SCREEN","TOP_LEFT.bmp")
MsgBox(0, $aResult[2], $aResult[3]]

ERROR: can't open include file "ScreenCapture/FindBMP.au3".

I have that stuff in an Au3 that I saved on the desktop. On the desktop i have FindBMP.au3 and ScreenCaptureFixed.au3 saved and an image file TOP_LEFT.bmp. I also have a folder on the desktop called ScreenCapture and in it are FindBMP.au3 and ScreenCaptureFixed.au3. I also tried

#Include "FindBMP.au3"

Edited by wuschelbeutel
Link to comment
Share on other sites

Are you running the script from the desktop folder? If not, you're pointing to the wrong folder when you try to use the include statement. Also, Windows uses backslashes "" in the path statement, you're using forward slashes, not sure if it affects things, but you should stick with Windows conventions when working in Windows.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Yes, I'm running the file from the Desktop and unfortunately backslash didn't work either.

I also realized that those scripts have "include once" directives in them, so I tried including only the FindBMP.au3 (since it's dependent on ScreenCapture). Unfortunately, that didn't work either.

These are the Scripts I'm using:

I verified for potential Typos and didn't find any.

I will now try #include <filename> while putting the files in C:Program FilesAutoIt3Include

Edit: Works!

Edited by wuschelbeutel
Link to comment
Share on other sites

This line #Include "..ScreenCaptureFindBMP.au3" is telling the script to look for the file one directory level up from the script directory, then in that folder look for the screencapture folder and in the screencapture folder look for FindBMP.au3. So, if running Windows XP it's looking in the folder "C:Documents and SettingsScreenCapture", on Vista/7 it's looking in "C:UsersScreenCapture". That's where your problem probably lies. Either user ".ScreenCapture" or just "ScreenCapture" if the include file is in the same folder as the script file.

EDIT: Fixed formatting because this forum software sucks

Edited by BrewManNH

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • 2 weeks later...

Prefered way:

In Scite pres Ctrl+1 --> SciteConfig --> define User Include Dir, for example: C:Program FilesAutoIt3Include_User

then click Save+Apply and copy your UDF to this directory. In this way you don't need to do any registry hacks.

I press Ctrl + 1 ... but nothing hapen in SciTE-Lite editor!?

p.s.

i want to "include directory" ...

How to include one or more directories in AutoIt?

Link to comment
Share on other sites

  • Moderators

microera,

You need the full SciTE4AutoIt3 package from here - then you get the SciTEConfig tool as well. :D

Or you can do it manually as explained in the Adding UDFs to AutoIt and SciTE tutorial in the Wiki. :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

You don't need to do that, see BrewManNH's post. You are looking in the wrong folder.

Edit: You are not even the right guy. Shut up.

Edited by AdmiralAlkex
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...