Jump to content

Viscouse

Members
  • Posts

    15
  • Joined

  • Last visited

Viscouse's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. That's done it, thanks again. I'm getting PTSD from trying to learn regex.
  2. Sorry, one more bit. How do I handle directories with spaces? Local $sProgramPath = "C:\gallery pics\nice ones\pics" I tried including a single quote around the path but that still doesn't work $sCMD = -d $sProgramPath & $sURL ConsoleWrite("$sCMD=" & $sCMD & @CRLF)
  3. Yes, correct Trong. I'm wondering if maybe a library is not in the correct location. The issue is specific to this machine.
  4. Sorry, I know this is an old topic. For this URL: https://www.youtube.com/watch?v=s_nc1IVoMxc This code can't seem to find it and reports "doesn't exist". I went generous with wintitlematchmode using 2 (partial string match) This code works on a different machine. Opt("WinTitleMatchMode", 2) #include <MsgBoxConstants.au3> if WinExists("Ren") Then MsgBox($MB_SYSTEMMODAL, "", "Window exists") Else MsgBox($MB_SYSTEMMODAL, "", "Window does not exist") EndIf
  5. Thank you ioa747. That worked!
  6. I tried, but I can't seem to crack this, what I think should be a pretty easy line of code. Also, /c can be replaced with /k, making no difference in any code below. First, this works to pull the URL, pass it to @comspec and correctly open a window Opt("WinTitleMatchMode", 2) Opt("SendKeyDelay",9) if winexists("Flickr - Google Chrome","") = 0 Then Exit WinActivate("Flickr - Google Chrome","") send("!d^c");Extract URL flickr RunWait(@ComSpec & " /c gallery-dl " & ClipGet()) First a question: Does comspec accept variables with a string? Because I think an easy solution would be to build a string and just pass it. The code below does not work. $u=https://www.flickr.com/photos/bm-mocs/46714523754/ RunWait(@ComSpec & " /c gallery-dl " & $u) Ultimately, what I want is this: $lots = "@ComSpec /c gallery-dl -o keywords.title="Spring" -o filename="{filename} {title}.{extension}" & Clipget()) ;or really: $lots = "@ComSpec /c gallery-dl -o keywords.title=$variable -o filename="{filename} {title}.{extension}" & Clipget()) ;so I am able to change $variable to different words. I understand readers may not know gallery-dl. At the command line, this sequence works: C:\gallery\gallery-dl -o keywords.title="Spring" -o filename="{filename} {title}.{extension}" https://www.flickr.com/photos/bm-mocs/46714523754/
  7. I should add that I have another machine, also Win7, but running IE8. I ran the same script as in the initial post and it worked perfectly. Could it be a IE issue?
  8. No zombies running. I found that advice in another thread and was the first thing I checked. As for what I'm trying to do, is just get IE open to a website. The code you see above is actually Example #4 from the helpfile. In fact, none of the examples work. I get the same error: "--> IE.au3 T3.0-1 Error from function _IECreate, (Browser Object Creation Failed)"
  9. I'm sorry to post, but I need some help. I have a Windows 7 machine with Internet Explorer 11 and the latest Autoit. I can't get this simple line to run and it's just bogglling me. #include <IE.au3> Local $oIE = _IECreate() Local $sHTML = "<h1>Hello World!</h1>" >"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "D:autoittest1.au3" --> IE.au3 T3.0-1 Error from function _IECreate, (Browser Object Creation Failed) >Exit code: 0 Time: 0.312 I have no idea why this is happening. Can anyone help me with any tips?
  10. Groovy. Looped(WinList + NOT StringInStr) = Solutiony goodness. Thanks for the assist PsaltyDS. I appreciate it!
  11. Thanks for pointing out all of that information. My apologies for not making my example perfectly proper. Please realize that this is part of larger code but I am trying to display the salient parts for this question instead of my entire code. I have fixed it to address your comment of no it doesn't work. Yes, it does. And that's not the point. #include <IE.au3> ;so IE functions will work Opt("WinTitleMatchMode", 2) ;so partial titles will be found instead of exact ones $oIE = _IECreate ("http://somewebsite.com") ;assume title is "First" _IELinkClickByText ($oIE, "click me") WinSetState("Explorer", "", @SW_MAXIMIZE) ; simple example of something that affects a windowMoving on. You tell me that if class & title are the same, instance will be different. Agreed. You also seem to think I don't know the difference between tabs & windows. Allow me to draw you a picture in order to better illustrate my point. In the attachment you can see 2 separate windows of IE7, both with an instance of 1. This was the first thing I checked. Additionally, I state that my issue is that one window will have a random, unknown title. So instance will NEVER be different since not everything else is the same. So I reiterate my question: In the example attachment, how do I differentiate between the 2 windows of IE, without using TITLE? Regarding the [CLASS:YourClass; REGEXPTITLE:YourRegExpPattern]", I have to figure out how to use StringRegExp and exclude the window I don't want to affect. I don't know exactly how to do this. I'll read up on it. Thanks.
  12. #include <IE.au3> Opt("WinTitleMatchMode", 2) _IENavigate ($oIE, "http://somewebsite.com") ;assume title is "First" _IELinkClickByText ($oIE, "click me") WinSetState("Explorer", "", @SW_MAXIMIZE) The first 4 lines work no sweat. The idea is that when the link is clicked, it opens a new IE window that has a completely random title, so I'm having a really hard time identifying it apart from the first IE window. I can't find something that is different between the 2 other than the random title. Class, instance are the same, both visible, etc. I know handles are different, but how do I use WinGetHandle since it uses the same identifiers (class, title, instance)? Is there a way to say "identify/use IE that is NOT [title=FIRST]"? A couple things I tried: WinSetState("[ACTIVE]", "",@SW_MAXIMIZE) ; not really accurate WinSetState("Explorer", "Done",@SW_MAXIMIZE) ; not accurate, sometimes closes FIRST window Any help appreciated, TIA.
  13. Picaxe's thread worked. Final solution; $oExcel = _ExcelBookAttach("Misson Balancer.xlsx","Filename") _ExcelSheetActivate($oExcel.Application, 2) _ExcelWriteCell($oExcel, "Goober", 2,2) Never would have figured that out. Thanks all.
  14. @PsaltyDS Nice! I found some interesting values. filename: Misson Balancer.xlsx filepath: E:\Misson Balancer.xlsx title: Microsoft Excel - Misson Balancer.xlsx [Read-Only] Interesting title. I wonder why the "read only" at the end. It's obviously not, unless it somehow denies access to Autoit. ? I know that using the filename & filepath don't crash. @rosaz Works. Thanks! I'm a bit weak on objects, and I was playing with the new toy I found that was Excel.au3, so I couldn't see outside the Excel Box! Ok. I could stop now. But I'm curious. Here's some works/doesn't work snippets... Works: $oExcel = ObjGet("", "Excel.Application") _ExcelSheetActivate($oExcel, 2) _ExcelWriteCell($oExcel, "Goober", 2,2) $oExcel = _ExcelBookAttach("Misson Balancer.xlsx","Filename") _ExcelWriteCell($oExcel, "Goober", 2,2) Notice the lack of the SheetActivate in the second example. Doesn't Work: $oExcel = _ExcelBookAttach("Misson Balancer.xlsx","Filename") _ExcelSheetActivate($oExcel, 2) _ExcelWriteCell($oExcel, "Goober", 2,2) I get this error: C:\Program Files\AutoIt3\Include\Excel.au3 (1086) : ==> The requested action with this object has failed.: If $oExcel.ActiveWorkbook.Sheets.Count < $vSheet Then Return SetError(2, 0, 0) If $oExcel.ActiveWorkbook^ ERROR I'm confused. Now I think it's the SheetActivate that doesn't work. But it works in rosaz's code. Ok, I'm off to look at the other thread.
  15. Hi there. Long time user, first time poster. I love using Autoit because 99% of the time I can figure out my own issues. But this time I'm just pain flummoxed. It's a pretty simple deal involving Excel. I want to write in an Excel workbook, which I can do. What I REALLY want to do is write in an existing file, not a new file. That's the sticky part. Here's what works: #Include <Excel.au3> $oExcel = _ExcelBookNew() _ExcelSheetActivate($oExcel, 2) _ExcelWriteCell($oExcel, "Goober", 2,2) ;_ExcelWriteCell($oExcel, $sValue, $sRangeOrRow, $iColumn = 1) Exit Here's what doesn't work (assume file is already open): #Include <Excel.au3> $oExcel = _ExcelBookAttach("Misson Balancer.xlsx","FileName") _ExcelSheetActivate($oExcel, 2) _ExcelWriteCell($oExcel, "Goober", 2,2) ;_ExcelWriteCell($oExcel, $sValue, $sRangeOrRow, $iColumn = 1) Exit The Output window in code #2 sez: C:\Program Files\AutoIt3\Include\Excel.au3 (1086) : ==> The requested action with this object has failed.: If $oExcel.ActiveWorkbook.Sheets.Count < $vSheet Then Return SetError(2, 0, 0) If $oExcel.ActiveWorkbook^ ERROR Since the error is coming from Excel.au3, I figured I was in over my head. Misc stats: Excel 2007 AutoIt v3.3.0.0 Excel.au3 v 1.5 (07/18/2008) which was the most recent I could find. Can't find any reference to this being not compatible with Excel 2007. I know the rest of my code is kosher since it works with a new book. I don't know if I'm not declaring something, or what. I don't get it. Anyone have any light to shed? EDIT: I know I said that I'm trying to do this via "Attach" to an open file. If I open the Excel file via _ExcelBookOpen, it works.
×
×
  • Create New...