Sorry to bother you all again,
I have put together a script using macro schedule pro that i have recently bought to locate an image on the screen and then to click it etc, this all works fine but here is my problem.
I compiled it to an exe. to use it on another computer which runs vista. I run the exe. and the macro's picture recognition doesn't work on that computer.
So i downloaded the macro schduler trial and installed it on that computer and i then copied the script and images to see if the images i had compiled would work on that computer, i put it together and then press run from the macro schedule trial window and it then worked.
So i am wondering if there is a problem compiling scripts to an exe. from a window xp system to then use them on a dif computer that runs vista or am i doing something wrong .
Exe. Problems Im not sure what to do
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Paths perhaps? Where are the .bmp files that the script needs to do the image recognition? Is it finding them? What values are being returned from FindImagePos? This will give you some clues. Use _DUMP_VARS and run the exe with /LOGFILE or use some MessageModals to show some diagnostics such as the return values from FindImagePos etc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Omg lol,
Sorry guys im a newbie to this,
yea i thought the images were compiled into the exe if not then there is my problem.
Thanks for your time and help.
Just a quick question will the images need to just be in the same folder as the exe or will they need to be in the same directory of folders from where i said they would be in the script.
Sorry guys im a newbie to this,
yea i thought the images were compiled into the exe if not then there is my problem.
Thanks for your time and help.
Just a quick question will the images need to just be in the same folder as the exe or will they need to be in the same directory of folders from where i said they would be in the script.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I would put them in the same location as the EXE/Script and refer to them with %SCRIPT_DIR% in place of the path. SCRIPT_DIR means same folder as script/exe self.
Or: If you want to "compile them in" you can import them into the script with Tools/Import Binary Data and at run time export using ExportData. In this case it may make sense to export them and refer to them in the temp folder using %TEMP_DIR%
Or: If you want to "compile them in" you can import them into the script with Tools/Import Binary Data and at run time export using ExportData. In this case it may make sense to export them and refer to them in the temp folder using %TEMP_DIR%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
This is good timing .... I just posted the following in another thread, but it could be helpful here for you also.
You should frequently use variable paths in your scripts, especially if they may be compiled to run on other systems. Here is an example of some of them, Marcus has already referred to some of them:
Variable paths, like these:
Built in with Macro Scheduler
%Win_Dir%
%Script_Dir%
%Desktop_Dir%
%Temp_Dir%
%Sys_Dir%
Samples of some others from the Environment
GetEnvVar>HomePath,vHomePath
GetEnvVar>UserProfile,vUserProfile
You should frequently use variable paths in your scripts, especially if they may be compiled to run on other systems. Here is an example of some of them, Marcus has already referred to some of them:
Variable paths, like these:
Built in with Macro Scheduler
%Win_Dir%
%Script_Dir%
%Desktop_Dir%
%Temp_Dir%
%Sys_Dir%
Samples of some others from the Environment
GetEnvVar>HomePath,vHomePath
GetEnvVar>UserProfile,vUserProfile
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Application Data Path
I am looking for a way to determine the "C:\Documents and Settings\All Users\Application Data" on a machine that may not have the english version.
I have searched the forum, and have tried about everything I can think of. I have tried the VBScript Get Folder method as shown here
VBEval>GetFolder("AppData"),AppData
I went to the Microsoft link that had more optons, as this returns if for the current user. Some return the same values even if you change what you put in, which does not make a lot of sense.
I have tried the GetEnvVar method that works when you use "Allusersprofile" and add the subfolder "Application Data" however, if it is in german will it be "Application Data"?
Maybe I am missing something, but if I compile a script I would like to be able to load it as a service, which I should be able to do if it is under All Users\Application Data.
Currently I have been using the vbscript method of GetFolder("AppData"),AppData as mentioned above and it loads as a service when the user logs on, but the user has to log on which is the difficulty. I just really need to have a way where it can be loaded and run without logging on as a particular user and I believe the only way is under all users.
Also, to load the compiled script as a service and make setup easy I use LaunchServ.exe from http://emutastic.emulation64.com/netosoft which is freeware. It is ten times easier than doing it following Microsoft's instructions. With this you just edit an ini file, run it and then go into services and turn it on.
So, any ideas on what to use to determine that "All Users" folder or where to put it keeping in mind that I have to have access to read and write to the folder?
I have searched the forum, and have tried about everything I can think of. I have tried the VBScript Get Folder method as shown here
VBEval>GetFolder("AppData"),AppData
I went to the Microsoft link that had more optons, as this returns if for the current user. Some return the same values even if you change what you put in, which does not make a lot of sense.
I have tried the GetEnvVar method that works when you use "Allusersprofile" and add the subfolder "Application Data" however, if it is in german will it be "Application Data"?
Maybe I am missing something, but if I compile a script I would like to be able to load it as a service, which I should be able to do if it is under All Users\Application Data.
Currently I have been using the vbscript method of GetFolder("AppData"),AppData as mentioned above and it loads as a service when the user logs on, but the user has to log on which is the difficulty. I just really need to have a way where it can be loaded and run without logging on as a particular user and I believe the only way is under all users.
Also, to load the compiled script as a service and make setup easy I use LaunchServ.exe from http://emutastic.emulation64.com/netosoft which is freeware. It is ten times easier than doing it following Microsoft's instructions. With this you just edit an ini file, run it and then go into services and turn it on.
So, any ideas on what to use to determine that "All Users" folder or where to put it keeping in mind that I have to have access to read and write to the folder?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You want CommonAppData
See:
http://msdn.microsoft.com/en-us/library ... S.85).aspx
Use this:
Simply replace ssfCOMMONAPPDATA in the VBEval line with any of the other ssf... names to get a different special folder.
This will work regardless of what language version of Windows you are using - it's hex 23 for commonappdata - and &H23 is same in German as in English ;-)
See:
http://msdn.microsoft.com/en-us/library ... S.85).aspx
Use this:
Code: Select all
VBSTART
Const ssfALTSTARTUP = &H1d
Const ssfAPPDATA = &H1a
Const ssfBITBUCKET = &H0a
Const ssfCOMMONALTSTARTUP = &H1e
Const ssfCOMMONAPPDATA = &H23
Const ssfCOMMONDESKTOPDIR = &H19
Const ssfCOMMONFAVORITES = &H1f
Const ssfCOMMONPROGRAMS = &H17
Const ssfCOMMONSTARTMENU = &H16
Const ssfCOMMONSTARTUP = &H18
Const ssfCONTROLS = &H03
Const ssfCOOKIES = &H21
Const ssfDESKTOP = &H00
Const ssfDESKTOPDIRECTORY = &H10
Const ssfDRIVES = &H11
Const ssfFAVORITES = &H06
Const ssfFONTS = &H14
Const ssfHISTORY = &H22
Const ssfINTERNETCACHE = &H20
Const ssfLOCALAPPDATA = &H1c
Const ssfMYPICTURES = &H27
Const ssfNETHOOD = &H13
Const ssfNETWORK = &H12
Const ssfPERSONAL = &H05
Const ssfPRINTERS = &H04
Const ssfPRINTHOOD = &H1b
Const ssfPROFILE = &H28
Const ssfPROGRAMFILES = &H26
Const ssfPROGRAMFILESx86 = &H30
Const ssfPROGRAMS = &H02
Const ssfRECENT = &H08
Const ssfSENDTO = &H09
Const ssfSTARTMENU = &H0b
Const ssfSTARTUP = &H07
Const ssfSYSTEM = &H25
Const ssfSYSTEMx86 = &H29
Const ssfTEMPLATES = &H15
Const ssfWINDOWS = &H24
Function GetSpecialFolder(FolderID)
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FolderID)
Set objFolderItem = objFolder.Self
GetSpecialFolder = objFolderItem.Path
End Function
VBEND
VBEval>GetSpecialFolder(ssfCOMMONAPPDATA),pathComAppData
MessageModal>pathComAppData
This will work regardless of what language version of Windows you are using - it's hex 23 for commonappdata - and &H23 is same in German as in English ;-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?