Jump to content

saywell

Active Members
  • Posts

    376
  • Joined

  • Last visited

Everything posted by saywell

  1. Are you going to rename it again, perhaps tomorrow? If so you need to have a plan as to how you will identify today's file tomorrow. A quick and dirty way would be to write its name in an ini file. The when you next run the program it can read the previous filename and allow you to rename it to the current date. If it's a blank logfile and you rename it to a new name for use each day, and leave the earlier ones in place, this won't be necessary - though you might want to add some functionality to delete log files older than a certain age, as good housekeeping. William
  2. Do it twice, once for each case. One will work, the other will fail. William
  3. It seems to be a file associated with freefilesync.exe. Try running that, with the batch file as the parameter. Or shellexecute. William
  4. Shouldn't it have a file extension? What happens when you double-click it? Is there an application associated with it? William
  5. Why not run a script on each local PC that copies all the files to your central computer? If you use the original script you could modify it to sort the files by camera before sending them. Or it could just send them all as they come, and work as previously with your script separating them out by camera and date on the central computer. William
  6. I use a 2-stage process. The first stage does a file-install of the actual updater, then closes and runs the updater. if the updater itself needs updating, it will be able to update the first-stage program without a problem, then next time it is run it will use the updated updater embedded within it. My first-stage prog has some other functions too [tidying up old files etc] but it doesn't have to doa nything if you just want it for updating stuff. William
  7. I think it's a limitation. I found it failed when i was writing this functionality a while back. If the documents are under your control, you could try using a table rather than a text box. It may be something about the S&R function looking only at range.text rather than range.wholestory - but that's beyond me in terms of suggestions to make it work. William
  8. Thanks, Rover. I'll give it a try when I get home - only have XP/single monitor at work to play on [hell to pay if I run DIY stuff on the 3-monitor - but still XP - PACS workstation!!]. Regards, William
  9. I've now got this set up as a shortcut on the taskbar, so only one click needed. The next step is to write a script that polls the system and detects when the second monitor has become unrecognised, and then call the DisplaySwitch.exe /extend command. I've found references to EnumDisplayMonitors and EnumDisplayDevices but I don't know how to use them [i'm not a WinAPI guru!}. Anyone know a bit [or, probably, a lot] more about this than I do? William
  10. Why not open it in an sqlite browser? There's a firefox add-on called SQlite manager, which i quite like. Others exist. You could use this to find out the table structure so you can write programmed edits etc in the future - or use its editing facility to make the occasional ad hoc edit that's no worth writing script for. William
  11. Update. Cand get sending the winkey + P to work, BUT my assumption re Rover's suggestion was wrong. DisplaySwitch.exe /extend does work, so I presume the 'extend' is internally preceded by a 'detect' action. For the moment, i've just created a shortcup, copied it into the taskbar and click it when needed. If I can figure out how to detect the monitors changing, I'll try to automate it. Thanks, Rover! William
  12. Home/End work as predicted, so i can send win-p, home, rt-arrow, rt-arrow to get where i want. Haven't had time to write it yet, but how do i divert the 'sends' to the windows OS rather than the active window? Or perhaps i don't need to? - Win-E opens explorer even if a window has focus; win-P may be the same. I'll have a play tonight. William
  13. Thanks. Rover: The displaySwitch probably won't work [i'll try when i get home as XP only here at work] as when it needs to be used,Windows can only 'see' one monitor. The second has to be detected before switching/cloning/extending. Xenobiologist: I suspect the same will apply to your solution [i'll look more closely tonight to see how it worsks] - but please feel free to correct me if I'm wrong! Songersoft: I'll try this when I get home. Tabbing wraps around, but I haven't tried home/end to see if that gives a fixed reference. Regards, William
  14. Hi, I've just set up a new Win 7 box for photographic work, and have added a second monitor. Monitor 1 is the old monitor, shared via KVM switch with other PCs. monitor 2 is connected only to this new PC. There's a bug/feature in Win 7 such that if one display is disconnected [eg the main monitor switched to another PC by KVM], it loses the other monitor output also. It comes back if you get Win 7 to 'detect'. This can be done via a right-click to the desktop and select 'change resolution', where there's a link [not button] to detect displays. This dialogue can also be forunfd via control panel. OR By pressing <WIN><P> which brings up the projector/multi-monitor dialogue strip, on which there's also a 'detect' option. I'd like to write a script for a single hot-key press to automate this, but am having no joy interacting with these controls - the autoit windows info tool doesn't recognise them. I can do s Send to emulate the <WIN><P> presses but sometimes it opens with focus at the start, and sometimes it remembers the last used, and sets focus at 'detect' so i can't just send a couple of Tabs and a return to simulate the key presses. Anyone got any suggestions to help here? Regards, William PS the Nvidia software doesn't have this ability, so it has to be via Windows7.
  15. Solved after more searching around $oWordApp.ActiveDocument.Range.WholeStory() $oWordApp.ActiveDocument.Range.Text= "Cancelled by user "
  16. Ok it's not strictly an Autoit question but it relates to using the word com object from my autoit prog. I need to delete the contents of a word document and replace it with a short message. I've tried playing with range.text but this doesn't include the tables etc., though it's fine for adding the message The VBA would be something like Selection.HomeKey Unit:=wdStory Selection.Cut or perhaps Selection.WholeStory Selection.Cut How do i convert this to Autoit? I'd thought something like $oWordApp.ActiveDocument.Selection.WholeStory $oWordApp.ActiveDocument.Selection.Cut $oWordApp.ActiveDocument.Range.Text = "Cancelled by user "&@YEAR&@MON&@MDAY&@HOUR&@MIN&@SEC The range.txt bit works on its own by replacing the old text with the message, but I can't get the same thing to work on the entire document - using wholestory in place of range.text just gives a com error. Any suggestions, anyone? Regards, William
  17. Thanks Mikeman. I know it's not really autoit, but there's so much knowledge here... I'd looked at autorun.inf and use it for a CD program I've written - but most memory cards don't have one, and I wouldn't want to have to install one on every card I might use. Some programs, eg Picasa, add themselves to the autoplay context menu when they're installed, so that they become an option if any card is inserted. That's what I'm after. Regards, William
  18. Hi, I'm updating my program for loading photos onto my PC [from memory card]. I'd like to have an option in the windoze 'autoplay' context so that when I insert the card, there's an option to run my app from the po-up context menu. I've searched forums for 'autoplay' - amazingly only 4 hits, none relevant. Any suggestions as to how to do this? I presume it will need some registry keys added/altered when the app first runs. Regards, William
  19. It seems that @SCRIPTDIR includes a backslash when it's being run from root directory of a drive. Try MsgBox (0, "backslash or not?", @ScriptDir) when run from the root of a drive [eg memory stick for test purposes], then from a subfolder. This isn't in the documentation, which just says: @ScriptDir - Directory containing the running script. (Result does not contain a trailing backslash) William
  20. This sounds horribly viral to me!
  21. The low-tech solution would be an array of wireless doorbells! Link William
  22. Global $Mon ; declares global variable - another quick and dirty method, ; rather than passing the variable in the return value. Monthname() ; runs the function which sets the value of $Mon DirCreate("C:\Sunday Reports\" & $Mon & "-" & @MDAY & "-" & @YEAR ) ; your bit, with $Mon substituted for @MON Func Monthname() Select Case @MON = 1 $Mon = "January" Case @MON = 2 $Mon = "February" Case @MON = 3 $Mon = "March" Case @MON = 4 $Mon = "April" Case @MON = 5 $Mon = "May" Case @MON = 6 $Mon = "June" Case @MON = 7 $Mon = "July" Case @MON = 8 $Mon = "August" Case @MON = 9 $Mon = "September" Case @MON = 10 $Mon = "October" Case @MON = 11 $Mon = "November" Case @MON = 12 $Mon = "December" EndSelect endfunc ; ===> Monthname William
  23. This is a quick and dirty solution - put it in a function and call it before you create the directory, and use $mon instead of @mon in the name. Select Case @MON = 1 $Mon = "January" Case @MON = 2 $Mon = "February" Case @MON = 3 $Mon = "March" Case @MON = 4 $Mon = "April" Case @MON = 5 $Mon = "May" Case @MON = 6 $Mon = "June" Case @MON = 7 $Mon = "July" Case @MON = 8 $Mon = "August" Case @MON = 9 $Mon = "September" Case @MON = 10 $Mon = "October" Case @MON = 11 $Mon = "November" Case @MON = 12 $Mon = "December" EndSelect William
  24. Water, I shall indeed test it on various machines here at work, but the problem is that it will be running from a CD sent to other hospitals, each with their own security policies. I guess if it works on all the ones I test here, I'll have to give it a go with the recipients and hope I don't get too many howls of anguish back! And if I do, add a test for success in setting up the share, with a fail running a different method eg writing, running and deleting a batch file! Thanks for your help. William [edit] - UPDATE The first PC I tried it on, other than my own, failed! It was OK with a DOS Subst from a batch file, though, so I think the security problem is real. Well worth a try, though! W.
  25. Thanks, Water. That works fine: #Include <NetShare.au3> $netshare = _Net_Share_ShareAdd ("","test",$STYPE_TEMPORARY,"C:\test") $sFreeDrive = DrivemapAdd("*", "\\" & @ComputerName & "\test") MsgBox (0,"Free", $sFreeDrive) DriveMapDel ($sFreeDrive) It will also allow me to remove my code that seeks the next free drive letter. My concern here is that this function may be blocked if the user doesn't have enough privileges - or would this work in any circumstances where the DOS subst command would work from a batch file? William
×
×
  • Create New...