automation

Automation: how to automate transforming .doc to .docx?

守給你的承諾、 提交于 2019-12-28 13:34:22
问题 I have a bunch of .doc files in a folder which I need to convert to .docx. To manually convert the .doc to .docx is pretty simple: Open .doc in Word 2007 Click on Save As... Save it as .docx However, doing this for hundreds of files definitely ain't fun. =p How would you automate this? 回答1: Automate Word. If you are using .NET, add Microsoft.Office.Interop.Word (make sure it is version 12 - equivalent to Word 2007 so you can achieve the above) reference assembly to your project and use it it

Auto-reload browser when I save changes to html file, in Chrome?

江枫思渺然 提交于 2019-12-28 08:00:42
问题 I'm editing an HTML file in Vim and I want the browser to refresh whenever the file underneath changes. Is there a plugin for Google Chrome that will listen for changes to the file and auto refresh the page every time I save a change to the file? I know there's XRefresh for Firefox but I could not get XRefresh to run at all. How hard would it be to write a script to do this myself? 回答1: I assume you're not on OSX? Otherwise you could do something like this with applescript: http:/

Using conditional statements inside 'expect'

孤街浪徒 提交于 2019-12-28 05:16:26
问题 I need to automate logging into a TELNET session using expect , but I need to take care of multiple passwords for the same username. Here's the flow I need to create: Open TELNET session to an IP Send user-name Send password Wrong password? Send the same user-name again, then a different password Should have successfully logged-in at this point... For what it's worth, here's what I've got so far: #!/usr/bin/expect spawn telnet 192.168.40.100 expect "login:" send "spongebob\r" expect "password

Using conditional statements inside 'expect'

大兔子大兔子 提交于 2019-12-28 05:16:06
问题 I need to automate logging into a TELNET session using expect , but I need to take care of multiple passwords for the same username. Here's the flow I need to create: Open TELNET session to an IP Send user-name Send password Wrong password? Send the same user-name again, then a different password Should have successfully logged-in at this point... For what it's worth, here's what I've got so far: #!/usr/bin/expect spawn telnet 192.168.40.100 expect "login:" send "spongebob\r" expect "password

reusing Internet Explorer COM Automation Object

情到浓时终转凉″ 提交于 2019-12-28 04:25:06
问题 I am using VBScript macros to utilize the InternetExplorer.Application COM automation object and I am struggling with reusing an existing instance of this object. From what I have read, I should be able to use the GetObject() method in vbscript to grab a hold of an existing instance of this object. When I execute the following code I get an "Object creation failed - moniker syntax error". Is my issue really syntax? Is my issue how I am trying to use this object? or can what I am trying to

Python - Control window with pywinauto while the window is minimized or hidden

与世无争的帅哥 提交于 2019-12-28 01:33:10
问题 What I'm trying to do: I'm trying to create a script in python with pywinauto to automatically install notepad++ in the background (hidden or minimized), notepad++ is just an example since I will edit it to work with other software. Problem: The problem is that I want to do it while the installer is hidden or minimized, but if I move my mouse the script will stop working. Question: How can I execute this script and make it work, while the notepad++ installer is hidden or minimized. This is my

Executing a PHP script with a CRON Job [closed]

风格不统一 提交于 2019-12-27 20:13:10
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I would like to run a PHP script every day at midnight. After research on how to do this, it appears that the best way to achieve this is to use a CRON job. If my php script was located at http://example.com

Is there a PHP equivalent of Perl's WWW::Mechanize?

巧了我就是萌 提交于 2019-12-27 10:46:31
问题 I'm looking for a library that has functionality similar to Perl's WWW::Mechanize, but for PHP. Basically, it should allow me to submit HTTP GET and POST requests with a simple syntax, and then parse the resulting page and return in a simple format all forms and their fields, along with all links on the page. I know about CURL, but it's a little too barebones, and the syntax is pretty ugly (tons of curl_foo($curl_handle, ...) statements Clarification: I want something more high-level than the

ntc-ansible “response” and “module_args” (how access?)

限于喜欢 提交于 2019-12-25 18:43:57
问题 I am using the networktocode ntc-ansible module in Ansible to control Cisco IOS devices (switches currently). I successfully can use ntc_show_Command to get 'show version' and 'show ip int brief' and put the result into a local file. But when I use the -vvv at the end of the ansible-playbook command, I see structured JSON output in the terminal. How do I get a access the "module_args" and the "response" from the ntc_show_command, ie. if i use "show ip int brief" and i want to know the status

Automating JavaScript confirmation prompt in IE using PowerShell

我与影子孤独终老i 提交于 2019-12-25 18:41:37
问题 I have the following JavaScript code in an HTML page: <script language="javascript" type="text/javascript"> function confirmAutoTransitionSelection() { var autoTransition = 'OFF'; if (document.getElementById('autoTransitionON').checked) { autoTransition = 'ON'; } return confirm('Are you sure you want to turn ' + autoTransition + ' the Auto Transition Setting?'); } </script> Also in the HTML code, I have the following input buttons that I'm auto-clicking with PowerShell script: <form method=