Jump to content

DarkAqua

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

235 profile views

DarkAqua's Achievements

  1. I have a XML file that i need assistance in parsing. Below is a snipping from the XML File: <Tasks> <Task> <BeginDate>2015/08/15 01:27:45,4375 (0)</BeginDate> <MangaName>Kono S o, Mi yo! (Kono S o, Mi yo! 1 --&gt; Kono S o, Mi yo! 155 - Just the Two of Them [End])</MangaName> <Website>MangaHere</Website> <SaveTo>F:\Manga\Kono S o, Mi yo!</SaveTo> <Status>Completed</Status> <Percent>100</Percent> <State>Stopped</State> <Queue>0</Queue> <Chapters /> </Task> <Task> <BeginDate>2015/08/15 01:28:49,9415 (0)</BeginDate> <MangaName>Tate no Yuusha no Nariagari (Tate no Yuusha no Nariagari 1 - A Royal Summoning --&gt; Tate no Yuusha no Nariagari 16 - The Third Wave of Calamity)</MangaName> <Website>MangaHere</Website> <SaveTo>F:\Manga\Tate no Yuusha no Nariagari</SaveTo> <Status>Completed</Status> <Percent>100</Percent> <State>Stopped</State> <Queue>0</Queue> <Chapters /> </Task> </Tasks> I have tried a couple of different ways but i haven't had any luck so far. I have messed with XML parsing with Rainmeter and Crystal Reports but im having difficulty with Auto-it. I need to parse the nodes <MangaName> and <Website> to a 2D Array with the <MangaName> as the first column and <Website> is the second column. Attached is the full XML File. Tasks.xml
  2. I am creating a script that will take the input from a barcode scanner and open a webpage to http://www.upcindex.com and search for the barcode. I have it working up until the point that i need to pull the name of the product. There is the link to the product page. http://www.upcindex.com/810354020292. and here is my code so far: ;Includes======================================================================================================================================= #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <StaticConstants.au3> #include <ListViewConstants.au3> #include <Array.au3> #include <MsgBoxConstants.au3> #include <GuiListView.au3> #include <IE.au3> #RequireAdmin ;Variables======================================================================================================================================= ;Gui============================================================================================================================================= ;MainGUI===== $Barcode = InputBox("Barcode", "Please Scan Barcode", Default, Default, 200, 120, 20, 40) $sUrl = "http://www.upcindex.com/search?q=" & $Barcode $oIE = _IECreate($sUrl, 0, 1, 0, 1) Sleep(2000) $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) ;Loop============================================================================================================================================ Local $GUIMsg While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndI'm having issues try to figure out what function i need to use to pull the product name from the page. Anyone have any suggestions?
  3. After Deleting certain parts of the script to try too find the problem i have discovered the statement Opt("GUIOnEventMode", 1) was causing the issue.
  4. I have added the changes you gave me but i am still unable to get the context menu items to work properly. New script below. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) $app = 'google' $path = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" $wintitle = "[REGEXPTITLE:(?i)(.*" & $app & "*)]" $list = WinList($wintitle) $WinNum = $list[0][0] * 20 $GUI = GUICreate("List Windows", 300, $WinNum, -1, -1, $WS_POPUP) $end = 0 GUISetState(@SW_SHOW) Switch $list[0][0] Case 1 $1 = GUICtrlCreateLabel($list[1][0], 20, 5) GUICtrlCreateIcon($path, -1, 0, 0, 20, 20) $m1 = GUICtrlCreateContextMenu($1) $m1i1 = GUICtrlCreateMenuItem("Minimize", $m1) $m1i2 = GUICtrlCreateMenuItem("Restore", $m1) Case 2 $1 = GUICtrlCreateLabel($list[1][0], 20, 5) GUICtrlCreateIcon($path, -1, 0, 0, 20, 20) $m1 = GUICtrlCreateContextMenu($1) $m1i1 = GUICtrlCreateMenuItem("Minimize", $m1) $m1i2 = GUICtrlCreateMenuItem("Restore", $m1) $2 = GUICtrlCreateLabel($list[2][0], 20, 25) GUICtrlCreateIcon($path, -1, 0, 20, 20, 20) $m2 = GUICtrlCreateContextMenu($2) $m2i1 = GUICtrlCreateMenuItem("Minimize2", $m2) $m2i2 = GUICtrlCreateMenuItem("Restore2", $m2) EndSwitch While 1 Switch GUIGetMsg() Case $m1i1 MsgBox($MB_SYSTEMMODAL, "Test", "Minimize Clicked") Case $m1i2 MsgBox($MB_SYSTEMMODAL, "Test", "Restore Clicked") Case $m2i1 MsgBox($MB_SYSTEMMODAL, "Test", "Minimize2 Clicked") Case $m2i2 MsgBox($MB_SYSTEMMODAL, "Test", "Restore2 Clicked") EndSwitch WEnd
  5. I am making a script to create a list of currently open windows of a specified program with program icons similar to windows preview when you point your mouse at a running program on your task bar which brings up a list of open windows for that program. Each window in this list will have a separate context menu upon right click. I have everything working great but the items in the context menu are giving me grief. When i open the context menu and try to click a menu item it does not create a message box that i have specified in the script for testing them. I thought i would have you guys take a look at the script and see what you though might be the problem. Note: This is extremely experimental script. #include <Array.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> GUICreation() Windowcheck() Func GUICreation() Opt("GUIOnEventMode", 1) $app = 'google' Global $path = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" $wintitle = "[REGEXPTITLE:(?i)(.*" & $app & "*)]" Global $list = WinList($wintitle) $WinNum = $list[0][0] * 20 $GUI = GUICreate("List Windows", 300, $WinNum, -1, -1, $WS_POPUP) Global $end = 0 GUISetState(@SW_SHOW) EndFunc Func Windowcheck() Switch $list[0][0] Case 1 $1 = GUICtrlCreateLabel($list[1][0], 20, 5) GUICtrlCreateIcon($path, -1, 0, 0, 20, 20) GUICtrlSetCursor($1,0) GUICtrlSetOnEvent($1, "item1") $i1m = GUICtrlCreateContextMenu($1) Global $id1 = GUICtrlCreateMenuItem("Minimize", $i1m) Global $id2 = GUICtrlCreateMenuItem("Restore", $i1m) Case 2 $1 = GUICtrlCreateLabel($list[1][0], 20, 5) GUICtrlCreateIcon($path, -1, 0, 0, 20, 20) GUICtrlSetCursor($1,0) GUICtrlSetOnEvent($1, "item1") $i1m = GUICtrlCreateContextMenu($1) Global $id1 = GUICtrlCreateMenuItem("Minimize", $i1m) Global $id2 = GUICtrlCreateMenuItem("Restore", $i1m) $2 = GUICtrlCreateLabel($list[2][0], 20, 25) GUICtrlCreateIcon($path, -1, 0, 20, 20, 20) GUICtrlSetCursor($2,0) GUICtrlSetOnEvent($2, "item2") $i2m = GUICtrlCreateContextMenu($2) Global $id1 = GUICtrlCreateMenuItem("2", $i2m) EndSwitch EndFunc While 1 Switch GUIGetMsg() Case $id1 MsgBox($MB_SYSTEMMODAL, "Test", "Minimize Clicked") Case $id2 MsgBox($MB_SYSTEMMODAL, "Test", "Restore Clicked") EndSwitch WEnd This script is made to show google chrome windows currently. I have looked at the example script in the function documentation for the context menu and it works great but i cant seem to decipher why the example works and mine does not. Example script provided below. ; right click on gui to bring up context Menu. ; right click on the "ok" button to bring up a controll specific context menu. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI Context Menu", 300, 200) Local $idContextmenu = GUICtrlCreateContextMenu() Local $idNewsubmenu = GUICtrlCreateMenu("new", $idContextmenu) Local $idNewsubmenuText = GUICtrlCreateMenuItem("text", $idNewsubmenu) Local $idButton = GUICtrlCreateButton("OK", 100, 100, 70, 20) Local $idButtoncontext = GUICtrlCreateContextMenu($idButton) Local $idMenuAbout = GUICtrlCreateMenuItem("About button", $idButtoncontext) Local $idMenuOpen = GUICtrlCreateMenuItem("Open", $idContextmenu) Local $idMenuSave = GUICtrlCreateMenuItem("Save", $idContextmenu) GUICtrlCreateMenuItem("", $idContextmenu) ; separator Local $idMenuInfo = GUICtrlCreateMenuItem("Info", $idContextmenu) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "Button Clicked", 'OK') Case $idMenuAbout MsgBox($MB_SYSTEMMODAL, "Menu Selected", 'About') Case $idMenuOpen MsgBox($MB_SYSTEMMODAL, "Menu Selected", 'Open') Case $idMenuSave MsgBox($MB_SYSTEMMODAL, "Menu Selected", 'Save') Case $idMenuInfo MsgBox($MB_SYSTEMMODAL, "Menu Selected", 'Info') Case $idNewsubmenuText MsgBox($MB_SYSTEMMODAL, "SubMenu Selected", 'Text') EndSwitch WEnd GUIDelete() EndFunc ;==>Example I have also attached the scripts for you guys to download and run directly. List Windows.au3 Context Menu Example.au3
  6. I was working trying to get a script that would use WinList() to create and display an array of windows with the tile defined by REGEXPTITLE such as Google Chrome. Example: #include <Array.au3> $list = WinList("[REGEXPTITLE:(?i)(.*Google*)]") _ArrayDisplay($list) I have with the code above made an array listing all windows with the title google which works great but my question is that, is it possible to use a variable in place of the Google in the above code? I have tried the below codes but am unable to get it to work. The array always comes back empty. The first two i have tried with a quotation around Google but still revive an empty array. #include <Array.au3> $wintitle = Google $list = WinList("[REGEXPTITLE:(?i)(.*$Wintitle*)]") _ArrayDisplay($list) #include <Array.au3> $wintitle = Google $list = WinList('"[REGEXPTITLE:(?i)(.*' & $Wintitle & '*)]"') _ArrayDisplay($list) #include <Array.au3> $wintitle = "[REGEXPTITLE:(?i)(.*Google*)]" $list = WinList($wintitle) _ArrayDisplay($list) #include <Array.au3> $app = Google $wintitle = '"[REGEXPTITLE:(?i)(.*' & $app & '*)]"' $list = WinList($wintitle) _ArrayDisplay($list)
×
×
  • Create New...