Jump to content

longtex

Active Members
  • Posts

    73
  • Joined

  • Last visited

Everything posted by longtex

  1. No problem - I'm not offended, and I didn't mean to be rude in return - and I really do appreciate it. The biggest problem with searching databases is figuring out what the key words should be. "English" is a terribly complex language with apparently more susceptibility to nuance (in terminology) than others. As a native "english" speaker, I would have written something like this: "I use inetget() for that. Link to doc: http://blahblahblah" Of course, we all know that the built-in "Help" material for the core au3 is very, very well done. I personally think it is as good a piece of documentation as anything and better than most commercial products. Thanks again.
  2. Seems to work. Thanks. I appreciate the pointer, but you need to work on your attitude.
  3. Okay! The upload-scan-to-Joomla app is working almost the way I want it. The last bit is to execute a script on the web server. It's being done right now with run("wget...") and it's fine, as long as wget() has been installed on the user's computer... I'd like to make this all-autoit, partly for robustness and partly to not have to install wget, too. The actual run argument is simple - all I'm doing is telling the web site to run a little php script that copies the scanned document(s) and adds the article(s) to the Joomla database: runwait("\Program Files\GnuWin32\bin\wget.exe http://example.com/cms/addone.php") Works fine, but I'm assuming there's a good (better? best?) way in autoit to just "go" to that URL - nothing is written back, so there's no need to look at results. How would you do it?
  4. S O L V E D It turns out that the proper FTPCommand string is not just "chmod 666 filename", but "quote site chmod 666 filename" I'm not 100% sure this works with autoit, because the source of that information was talking about VB and the (presumably) selfsame "FTPCommand()" as found in wininet.dll Let's just see about that. Change the string and lose the WORD "quote", and it works. I'm not sure why the cli ftp was happy with the WORD, but at this point I don't friggin' CARE. Hah! To recap: $result = _ftpcommand($connex,"site chmod 666 myfile.name") works like a champ.
  5. I'm almost done with a little app that ftp-uploads a scanned file and an accompanying paramaters file to a Joomla! web server. The parameters are read by a bit of PHP code inserted in the top level of Joomla! and a new article is written, which includes a link to the scanned file. This allows clerks to create content simply by dropping a document in their scanner - the scanner driver & software (ScanDall) saves the scanned document and kicks off my app, which lets the clerk pick a target area and enter a short description... and voila! fresh scanned content, in seconds. It works fine, with one small problem: the ftp'ed files are owned by the uploader and not by "www-data", which is the Apache user who runs the web site; the file attributes allow only the owner to access the files, so until we manually change either the owner or the attributes, Joomla! doesn't have access to the file. I'd love to just change the attributes the ftp server saves the files under, but so far none of the umask fiddling has worked. I wouldn't mind it if www-data could be used as the ftp user, but that also seems to be not possible (at least, not without serious security comppromises). Maybe there's a better way to upload the file... but right now, I'd settle happily for just being able to chmod or chown it, since that works perfectly when it's done manually. I know this is possible, since the GUI FTP clients I've looked at (I use Total Commander) have the chmod feature builtin, and it works!
  6. Nope. I had a heck of a time finding it, and I may not have found the right one - I used ftp_ex lib and it appears to work fine (the outting/sending, etc), but it fails to chmod the file (or chown, which would accomplish what I want, also). The Win ftp command set does not include chown or chmod (according to its help), which may explain the failure. However... the various GUI FTP clients that I've looked at all seem to support at least chmod with no problems at all, so I'm assuming there is somewhere an autoit-accessible function to do this. I'm going to go ahead and open a new thread, since this one specifically mentions ftp in the title, and it looks like the solution lies elsewhere. I'll edit this to point to the new thread once it's posted.
  7. Sounds plausible. I'll give that a shot asap. I'm a believer in searching... but it's dependent on finding the right keywords (and more, o'course)... I'm not sure I saw ftp_command() in any results so far, at least not regarding ftp, and I didn't make the connection for whatever reason. Thanks - Tex
  8. I've got a little autoit app that ftp's a given file (actually comes from a scanner, whose driver executes my app automagically) to a linux web server (running for this purpose a Joomla-operated website). When the file is uploaded, its permission attributes are at "0600". I need to change this. chmod works fine... manually; I know the capability is there, because my GUI FTP client (Total Commander) has no problem changing the permissions... but I need to be able to do it from inside the autoit app so it's absolutely seamless, no manual steps involved (other than typing in a name for the file and selecting the destination from a drop down list). Okay... so in the app, we're logged in with the exact same user as in the GUI FTP client, putting a couple of files to the exact same directory. Now, the files are sent, and... chmod($filename,"0644")... Is there anything in the _ftp() libs that can chmod, or how else can autoit handle it? Thanks - Tex
  9. Wow! Thanks! I think this may be the fastest answer I've ever seen to a post... maybe it kinda helps because it's a pretty simple one, but, still... I'll def pass this along to her... hell, I'll even look at it my own self!
  10. I have a friend who is a complete novice at programming. I thought perhaps AU3 might be a decent place to start. I thought I'd send her instructions on how to download and install it, and join the forum, and then... I reckon I need to explain briefly the programming process to her and show her how the editor works and how to Go and Build, but I'm still gonna need to point her at some good material describing the nuts and bolts... there's lots of stuff for languages like VB and PHP, with tons of examples, but is there anything for AU3? I know there are examples, and samples in much of the doc/manual, but is there any progressive training docs?
  11. I looked again - I actually have one computer that does NOT have AU3 on it, and in scrounging around I had found the file - I think it's just "au3.properties" - and edited it manually... and it worked fine... of course, the usb stick's drive letter varies from e: on some machines to l: on others, so it's a manual edit every time. I haven't paid a lot of attention to scite goodies, so I probably just didn't notice that side of it. Let me ask you another question: some of the PortableApps don't get updated as they probably should, and certainly not automagically. Since AU3 doesn't (does it?) update itself, what are your plans regarding updates? Thanks again.
  12. Fantabulous. PortableApps is a fooken great set of progs. Even for the non-hacker, having a pocket-portable drive with your internet apps (FoxFireFox and Thunderbird) and your office suite (Open Office) is incredibly handy. You can work on documents, interact on the web, check email... always with the same interface. I've been using two 4GB sticks - one for personal, one for work - with a pretty complete set of PA progs plus some that aren't "official" but do work (e.g. Total Commander - yes, I'm so fooken gray in the beard that I actually used Norton Commander on DOS). I made one for my favorite wife so she can carry data AND her apps wherever she goes. Took a while to wean her away from Micro$oft Office, but now she uses Open Office for her docs and sheets, 'cause OO will save as .doc and .xsl if needed. I actually put the "regular" AU3 on my sticks... and it seems to work fairly well so far, but I'll bet this "official" one is cleaner - I don't think I've used mine on a system that I didn't have a "real" AU3 on, so the "official" one will likely prove much better - particularly as I've been doing some stuff for people where it's inconvenient to install the full AU, and this should make that a LOT easier to deal with. Thanks!
  13. I've not seen that url anywhere. After I got the ocx registered, there was another error, about it being not licensed. I fixed that with a link found heret: http://www.access-programmers.co.uk/forums...5803#post275803 I take your point about the global - I was just trying to give a working example of the function after getting it working as a standalone. As you no doubt read, it was created from the example in the help file, and in returning it to a function I didn't move the global, that's all. Unfortunately, in order to test it thoroughly, I have to make it fail, and it doesn't fail on my computers (now). I'll be testing it at the library, but it's slightly inconvenient, as we're in a small, remote town, and our library is open from 1000 to 1730 only... Do you have any idea where that url came from? As far as checking the object - sure, you're right... but it depends on what you're using it for... in the particular context (it's a EULA), we can't simply QUIT... need to know WHY it fails, and hopefully be able to take some sort of remedial actions and try repeatedly until - having tried everything we know about - we finally have to give up and report failure. I've been flogging away at this for quite a bit, so I've probably lost sight of some of the things I had to do to make it work. The app for which I developed it is explained in some detail in the two or three threads leading up to this one. I'd love to list them for you right here, right now, but I've got an appointment in a few minutes, so I have to post this and go... you might try searching for "longtex" - there's one thread in example scripts regarding Word Automation (last page) and another in ActiveX...
  14. Here's the current resolution to this issue. As far as I can tell, the richtext controls do NOT display DOC files - however, they DO display RTF files. I have a program now running, displaying a EULA file in RTF, with Agree/Don't Agree buttons and appropriate action. Look in Example Scripts, for EULA... this may (probably will) get more attention, but for now, I'm calling it okay. Thanks for all the help from everyone!
  15. Here's a simple EULA script - displays an RTF file, gets Agree/Disagree, and if agreed, executes whatever else you want. ; Hacked from the guicctrlreateedit example by longtex 20080625 ; Needs: MSCOMCT2.OCX in system32 but it's probably already there ; longtex sez: not if you're running XP Pro... #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) xp27_eula() func xp27_eula () Global $oMyError Local $oRP, $iagree, $noagree, $GUIActiveX, $msg local $snert, $agreed local $eula_title, $noagmsg, $eula_ok_proc, $eula_rtf_file $eula_title = "Library User Agreement" $noagmsg = "In order to prevent terrorists from hurting us because they hate our freedoms, it is necessary that we give up some or all of our freedoms. You don't agree, so you can't use this computer. Under the terms of the various provisions of the various Patriot Acts, you are or may be a terrorist. Please don an orange jumpsuit, place a bag over your head, and report to the nearest Homeland Sekkkurity Detention Center immediately. Failure to comply may result in loss of all remaining freedoms, including Life, Liberty, and the Pursuit of Happiness." $eula_rtf_file = "C:\scans\libula.rtf" $eula_ok_proc = "Notepad.exe c:\dipdipdip.txt" $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $oRP = ObjCreate("RICHTEXT.RichtextCtrl.1") GUICreate($eula_title, 600,400, -1, -1, BitOR($ES_READONLY,$WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN,$ES_AUTOVSCROLL, $ES_AUTOHSCROLL)) $iagree = GUICtrlCreateButton('I Submit', 405, 377, 70, 20) $noagree = GUICtrlCreateButton('No Way!!', 475, 377, 70, 20) $GUIActiveX = GUICtrlCreateObj($oRP, 10, 10, 550, 300) GUICtrlSetPos($GUIActiveX, 10, 10, 300, 590) $agreed = 0 With $oRP; Object tag pool $snert = .deftextrtf() $oRP.LoadFile($eula_rtf_file) $orp.refresh() EndWith GUISetState();Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $iagree $agreed = 1 ExitLoop Case $msg = $noagree $agreed = 0; ;msgbox(0,"Can't do it","In order to prevent terrorists from hurting us because they hate our freedoms, it is necessary that we give up some or all of our freedoms. You don't agree, so you can't use this computer. Under the terms of the various provisions of the various Patriot Acts, you are or may be a terrorist. Please don an orange jumpsuit, place a bag over your head, and report to the nearest Homeland Sekkkurity Detention Center immediately. Failure to comply may result in loss of all remaining freedoms, including Life, Liberty, and the Pursuit of Happiness.") ExitLoop EndSelect WEnd GUIDelete() if $agreed > 0 Then msgbox(0,"","I swear to fricken God I'm gonna run something for ya"&@CRLF&@CRLF&"probly gonna be '"&$eula_ok_proc&"'") run($eula_ok_proc) Else msgbox(0,"Failure to Submit",$noagmsg) EndIf EndFunc Func MyErrFunc() MsgBox(0, "AutoItCOM Test", "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ , 5) ; Will automatically continue after 5 seconds Local $err = $oMyError.number If $err = 0 Then $err = -1 SetError($err) ; to check for after this function returns EndFunc ;==>MyErrFunc
  16. Okay - I've got a working prototype - it's still a WIP, but I'm gonna post it in the example scripts anyway - the word EULA will be in the subject...
  17. Problem Solved: Kuller Mi Stoopid Well, the last thing turns out to be this (to be fair, no one else mentioned it, either, so...): This (apparently) doesn't display DOC files, only RTF's. I opened the doc in Wordpad and saved it as libula.rtf, and it shows up just fine... now all I have to do is see if I can get the scroll bars to work (not sure I care about that a whole lot... the page keys work...) and make the box a decent size and put the buttons at the bottom... when I get it done, I'll post it - it should make at least a start on a generic EULA function, if any gives a rodent's posterior. Thanks to all the helpers!
  18. Here's the first little bit of what it displays. In the standard example from the help file for guictrlcreateedit() I replaced the line .text = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload' ; with $oRP.LoadFile("c:\scans\libula.doc"); and it displayed Ooops - no way to copy this, I guess... I copied it from the gui box, but... anyway, believe me, it's mostly the little square "checkbox" characters that are often displayed when an app doesn't know what else to do, and various graphics squiggles... I'll visit the link, and also see what, if anything happens with .text and/or .textrtf - I had - as noted - earlier tried .text = $orp.loadfile() without resulting in ANY text at all - I'll fiddle with .text and .textrtf some more. Thanks!
  19. I was trying .text=$oRP.ReadFile("filename.doc"), which gave an error. I changed it to .text=$oRP.LoadFile("filename.doc"), which didn't give an error, but left the text blank. I changed that to just $oRP.LoaadFile("filename.doc"), which sort of worked. I say "sort of" because while it DID load the contents into the display, it not only isn't formatted, it is full of garbage characters, just as if you loaded it into a plain text editor. I'm hoping there's a parameter to cause it to be formatted... ???
  20. You're right - it refers to Richtext.Richtextctrl, but I can't find doc on it. I guessed a ".ReadFile" method existed, and it didn't say "No", but it didn't like the file name for some reason. I'll try ".LoadFile" and see if that's any better... but I still don't know where to find the actual doc that describes all the methods and properties - can you point me to it? To elucidate: yes, there is an existing .doc file. All I want to do is display it, along with a couple of buttons labeled "Yes/No" or "accept/Decline" or whatever, and then act appropriately on the response. The document is clearly going to be like all the other (*&#@$ EULA's in the world, that is, extremely long, so it will need to be displayed with sliders... Thanks!
  21. Rich Text Control - write a EULA See also Word Automation LIb thread in Example Scripts http://www.autoitscript.com/forum/index.ph...0461&st=105 I'm trying to do a fairly basic EULA-type thing for the local Public Library. Maybe I'm going about it the wrong way, but it seemed like a good idea when I jumped in... the idea is that the user runs it instead of IE or FF, and if he agrees, then it runs IE or FF, otherwise... sorry, citizen: of COURSE you have a right to use public facilities, but unless you agree to be fingerprinted, photographed, and searched, we can't let you in. I've been pointed at what appears to be pretty dang close... the example in guictrlcreateedit() doc, which shows a rich text edit box (although it's a write, not a read)... I jumped through a couple of hoops and got MSCOMCT2.OCX properly installed, and tracked down a fix for a registry problem (see the Example Scripts thread), and the example now runs. Hopefully, the only other big hoop I need to jump through is getting the text from the .doc file into the text object, instead of hard-coded text, but I haven't been able to make that happen - It looks like there should be a ReadFile() function - oh, sorry, uhhhh... method? - in the richtext control, but I haven't been able to track down the docs on it... even then... it remains to be seen if it'll work, but that's the next step. If you can point me at the ReadFile() docs or if you have a better idea on the Eula... anyone?
  22. Got it - it's a registry problem (apparently). Here's where I found the fix Now... at least the example doesn't error off (I just copied the example under guictrlcreateedit, as directed). I'll try out the doc file and see if it's going to work... Still... what does anyone suggest about possibly automating via AU3 the installation and registering of the ocx libs and the registry hack linked above?
  23. Apparently, that's not it - I'm updated to the 6/12/2008 version. Same error "not licensed for use"... let's see... yep, same line Assuming that this gets resolved - it obviously is dependent on the installation of Windows software on the target machine(s), which is something I think we'd all like to avoid: after all, one of the attractions of AU3 is to avoid needing outside libs. What can we do to address this problem?
  24. I did, finally. I'm not much of a Windows hand - most of my work is on Linux systems, and the tips I found first, on adding the ocx, didn't say anything about registering... duhhh... Anyway, after registering, it still throws an error - says it's not licensed for use... I probably need to update - it's an older AU3. I'll do that and report back. Thanks!
  25. It looks promising, but threw an error. Looks like it wanted MSCOMCT2.OCX which was not on my system. I downloaded MSCOMCT2.CAB from ms, put it in \windows\system32 and extracted MSCOMCT2.OCX but I still get two errors - both show an OK box, but time out without user input. The first one is from line 49, and is styled "invalid class string". Any idea?
×
×
  • Create New...