I am working on a windows project using VB Script (I am currently writing it in notepad). It is a file selector and I want the user to select a file and the script to remember the file selected. The way I found how to do this is to use a userform. The only tutorials that I found are done in an Excel environment and didn't seem applicable to a non-Excel script. Is there a way for me to use a userform in my program? If not, I just want a dropdown message box that allows a user to select a row and for the script to remember the selection.
Related
I would like to add a context menu item in MacOS Mojave which gives the option to create a new file in the finder on a right click (the way you would in windows). I would also like to be able to specify the file type (text, word, html, css, javascript, etc)
I have followed a tutorial online in order to create the context menu item with automator but I am not familiar with writing shell scripts.
is it just as simple as:
for f in "$#"
do
touch "$f"
done
I was able to implement this following the instructions here: How to get Create New Text File from context menu
The only drawback as it stands is that you need to select a folder in finder to get the context menu. I would like to be able to click in the current I am in and get the menu but I can live with this. Hope this helps someone else.
This tool provides the "Create a file here" option out of the box. With this tool you can easily create your own options as well by writing simple shell scripts. The tool is free and the page has a link to the source if you want to check the source. The source has a shell script that creates a file in a directory that is given as an argument to the script. The script avoids file name conflicts when creating new files.
I have automated VB script and it will be do the following tasks:
It will allow user choose the excel sheet
Inserts the macros into chosen excel sheet
Export (SaveAs) into .xls format (which has macros)
But the problem is step (1), all Excel sheets are in "protected View". Every time I have to change the protected view to edit mode manually then move further. Is there any way that I can change this setting through VB script only to avoid manual intervention?
Please advise. Thanks in advance.
I wrote a macro in Excel VBA that can scrape files with an .f06 extension for certain data and then creates a spreadsheet that summarizes the data.
It is inconvenient to have to find the Excel workbook, open it, run the macro, & select the .f06 file to generate this summary.
I prefer to right-click on the .f06 file directly and have an option called 'scrape' that I could select and then it would run the code automatically.
1) Is this possible?
2) Can I use the existing macro-enabled Excel spreadsheet as the referenced code? Or do I need to re-write it in another language?
I am using Windows 7 Enterprise SP1 if relevant.
Thank you.
This is possible, but if you're on a company computer, I doubt that you'll be able to do some of the required steps.
1) write a VBScript for your macro according to the following guide:
http://wellsr.com/vba/2015/excel/run-macro-without-opening-excel-using-vbscript/
2) Launch the VBS you wrote in Step 1 from the right click menu, according to the following guide:
http://www.visualbasicscript.com/Launch-vbs-from-the-rightclick-menu-advanced-m32062.aspx
Best of luck!
I have custom Alfred workflow to File Filter some folders of my choice. I have two actions - to browse with Alfred, and, with CMD modifier, to open in Sublime.
I want to have an action where I may choose which program I want to open it in. I use 2-3 programs for basic editing, so I want to be able to select one of these.
Workflow would be:
start my workflow
enter few chars to find file
select a file with CMD
choose editor of choice from the list
How to implement the last thing? In other words, how to implement incremental actions e.g. "do this with this and then this".
There're two ways to do it.
Because you can choose which application will be used to open the file instead of the default one. A simple idea is using different keyword for each application. e.g. vim [file-name] for vim while sublime [file-name] for sublime.
Another way is using Run Script instead of Open File. An Apple script or Bash script can get the result in File Filter and open different application as you wish.
I have a tool based on .net. I need a vb script which would open this tool (.exe file) and then select 3 radio buttons, click on a button to browse a xml file stored in same folder and then click on invoke button. Is this possible? I am a complete fresher and just have this idea in mind for an automation. This is required as I have to perform the same steps daily.
I could find this code:
CreateObject("WScript.Shell").Run("""C:\Users\abc\Desktop\folder\Tool.exe""")
Which is doing my task to open the .exe file perfectly. Can someone help/guide me in achieving the further steps?
You might be better off making your tool work via the command line and having it accept arguments.
That way, you could use a .bat file to call your 'tool' passing in the arguments it needs and away you go.
These should get you started on your quest.
Creating a HelloWorld Console Application Using VisualBasic.NET
How to Parse Command Line Parameters?
What is a bat file