Jump to content



Photo

Include files don't open


  • Please log in to reply
10 replies to this topic

#1 wuschelbeutel

wuschelbeutel

    Seeker

  • Active Members
  • 20 posts

Posted 14 June 2012 - 02:22 AM

#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, 14 June 2012 - 02:24 AM.








#2 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,045 posts

Posted 14 June 2012 - 03:33 AM

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.

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#3 wuschelbeutel

wuschelbeutel

    Seeker

  • Active Members
  • 20 posts

Posted 14 June 2012 - 02:04 PM

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:
http://www.autoitscript.com/forum/topic/66545-find-bmp-in-another-bmp-imagesearch/
http://www.autoitscript.com/forum/topic/...not-be-found/page__p__703562#e


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, 14 June 2012 - 02:36 PM.


#4 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,409 posts

Posted 14 June 2012 - 03:06 PM

http://www.autoitscript.com/forum/topic/140981-cannt-open-include-file/
http://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE

#5 wuschelbeutel

wuschelbeutel

    Seeker

  • Active Members
  • 20 posts

Posted 14 June 2012 - 03:24 PM

Thanks for the links,

Are the registry edits really needed for includes that are in the same folder as the script you're running? I'd rather just dump it in the installation directory's Include folder then (and make a backup).

#6 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,409 posts

Posted 14 June 2012 - 03:38 PM

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.

Edited by Zedna, 14 June 2012 - 03:39 PM.


#7 BrewManNH

BrewManNH

    באָבקעס מיט קודוצ׳ה

  • MVPs
  • 7,045 posts

Posted 14 June 2012 - 04:10 PM

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, 14 June 2012 - 04:12 PM.

How to ask questions the smart way!

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 editorGUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.

GUIToolTip UDF Demo - Demo script to show how to use the GUIToolTip UDF to create and use customized tooltips.

Posted Image


#8 microera

microera

    Wayfarer

  • Active Members
  • Pip
  • 70 posts

Posted 24 June 2012 - 09:17 AM

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?

#9 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,744 posts

Posted 24 June 2012 - 09:30 AM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#10 microera

microera

    Wayfarer

  • Active Members
  • Pip
  • 70 posts

Posted 24 June 2012 - 09:57 AM

WOW! :D
Thanks Melba23!

#11 AdmiralAlkex

AdmiralAlkex

    I'm on a boat

  • MVPs
  • 4,493 posts

Posted 24 June 2012 - 03:13 PM

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, 24 June 2012 - 03:17 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users