scanie
Active Members-
Posts
23 -
Joined
-
Last visited
scanie's Achievements
Seeker (1/7)
0
Reputation
-
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
I've finished the script! And it works just the way I wanted! Thank you jdelaney and HeavenlyDemon for your help. I took the best from both of your scripts and combined them to a rainbow -
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
From the script that you provided: $file_read = StringReplace($file_read, " <Server></Server>", " <Server>" & $read_server & "</Server>") $file_read = StringReplace($file_read, " <To></To>", " <To>" & $read_to & "</To>") $file_read = StringReplace($file_read, " <From></From>", " <From>" & $read_from & "</From>") FileDelete($new_file) FileWrite($new_file, $file_read) from my XML: <SendEmail> <Server></Server> <Subject>Daily Backup Report</Subject> <To></To> <From></From> <Body></Body> I got the script from jdelaney to work but I still haven't figured out how to combine it with your GUI Thank you both for your help so far! -
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
It creates a new file with the same contents as the original. -
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
This was a nice way to do it! It creates the new file but it doesn't have the changes in it. I have tried to find the error but I can't.. -
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
Thank you! It can't get it to prompt me for input though. And it doesn't write anything to my XML file. It doesn't do anything except loading the XML I believe. Did you try it on your side? Do I have to do anything special or install something? -
Edit a few lines in XML file - use values from popup?
scanie replied to scanie's topic in AutoIt General Help and Support
kylomas, Here is the entire XML file: <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Date>2012-03-01T14:31:50.2136</Date> <Author></Author> </RegistrationInfo> <Triggers> <EventTrigger> <Enabled>true</Enabled> <Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-Backup"><Select Path="Microsoft-Windows-Backup">*[System[Provider[@Name='Microsoft-Windows-Backup'] and EventID=4]]</Select></Query></QueryList></Subscription> </EventTrigger> </Triggers> <Principals> <Principal id="Author"> <UserId></UserId> <LogonType>Password</LogonType> <RunLevel>LeastPrivilege</RunLevel> </Principal> </Principals> <Settings> <IdleSettings> <Duration>PT10M</Duration> <WaitTimeout>PT1H</WaitTimeout> <StopOnIdleEnd>true</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>P3D</ExecutionTimeLimit> <Priority>7</Priority> </Settings> <Actions Context="Author"> <SendEmail> <Server></Server> <Subject>Daily Backup Report</Subject> <To></To> <From></From> <Body>SCANERGY-VMM Backup Successful!</Body> <HeaderFields /> </SendEmail> </Actions> </Task> The file is used by Windows Backup and we are using it at work. I want my colleagues to be able to use this at different customers, and all customers have different smtp-addresses and server names. That's why I thought that a popup would be nice. Run the script, fill out the popups and you're good to go! I have searched this forum and also Google for how to do it in Autoit or vbscript.. But I never thought it would be this hard.. It seemed easy when I thought about it -
I'm trying to create a script that can be used for editing an XML file. I want the script to show a popup and ask for which text to insert. Example: "Insert the server address and press OK." And when the server address has been typed in it should insert that and then go to the next line and show a new popup. These are the three lines I want to edit. Server, to and from. <Actions Context="Author"> <SendEmail> <Server></Server> <To></To> <From></From> <HeaderFields /> </SendEmail> </Actions> Can it be done easily?
-
No go This is what works best at the moment: Run(@ComSpec & " /c " & "C:BGInfoBginfo.lnk", @TempDir, @SW_HIDE) $Title = "BGInfo" WinWait($Title, "", 60) WinSetState ($Title, "", @SW_HIDE) Send("{ESC}")
-
What do you mean with minimizing the "screen"? The BGInfo window only has one button and it's the X. If that's what you meant?
-
The first script you provided closes the window as soon as the BGInfo window loses focus, but the script doesn't close afterwards. The second script doesn't work at all, strangely enough. The script that worked the best so far was the one you provided before your last post. But, it's not consistant, because it works fine on my machine even though other windows are open in front of it. But on some other machines that I have tried it on, it doesn't always hide the window.. Haha, this has given me more work than I thought it would I thought this was going to be an easy task, I have done several autoit scripts before that has been more complex..
-
scanie reacted to a post in a topic:
Exit script after "While" loop
-
You sir, are awesome! It worked, at least on my test rig. I will try it on some other clients during the day! But it seems to me that you have solved my problem. Big thanks! P.S, how would I insert a loop in this script?
-
Thank you! It almost worked! As long as no other windows steal focus from BGInfo it closes as it should, but since a lot of other applications will launch at the same time this won't do it in the long run.. Thanks, nice suggestion. And I thought it worked for a little while, but then I noticed that the icon from the taskbar was gone as well as the window.. Geez this is frustrating
-
Hmm ok, I will try your script on Monday when I'm back at work. Thank you! I will give that a try if John's version don't work! Thanks
-
The organization that hires me doesn't want BGInfo on the wallpaper. They want in the taskbar. BGInfo supports this but it only works as intended on XP. On XP the application starts minimized to the taskbar automatically. On Win7 it starts in a window AND in the taskbar, if you close the window it stays in the taskbar but if you kill the process you close both the window and the icon in the taskbar. C:BGInfoBginfo.exe C:BGInfotaskbar_settings.bgi /taskbar /timer:0 /nolicprompt
-
Yes, that works. I have tried it. But then the app closes for good, I want it to stay in the system tray. Good suggestion though!