How to Open Notepadd ++ With Textbox.text? - vb.net

I have a small program that I am working on that grabs a script within an object model. I can get the script to display in the text box and I can get notepad++ to launch on button click.
What I would love to do is have the text from the text box open inside notepad++ so that i may edit the script.
Does anyone out there have any ideas?

Save the text from your text box to a file, like this:
System.IO.File.WriteAllText("path and name of text file.txt", textBox1.Text)
Now you can force the user to use Notepad, by doing this:
Process.Start("path to notepad.exe", "path and name of text file.txt")
Or you can have the system determine what the user's preferred application (say they have Notepad++) is for a .txt by doing this:
System.Diagnostics.Process.Start("path and name of text file.txt")

Related

Google search input text box can be found using name but not id

I am trying to go to the url "https://www.google.co.in" enter the word "Googling" in the input text box and then click on the search button.
The input text box has id "gs_htif0".
So the statement
driver.findElement(By.id("gs_htif0")).sendKeys("Googling");
should work. But it's not. The statement
driver.findElement(By.name("q")).sendKey("Googling");
is working fine. It fills the search box with the word "Googling".
It seems you tried incorrect id. Please check with :
driver.findElement(By.id("lst-ib")).sendKeys("Googling");

selectDialog with address bar instead of dropdown with Photoshop script

I'm writing a custom script for Photoshop to handle batch processing of images. I have two input folders and an output folder that I need to specify. Right now I'm using something like this to select my folders:
var inputFolder = Folder.selectDialog("Select a folder of images to process");
Because I'm working on a server with a pretty deep folder hierarchy, it can be a real pain to select through the drop-down menu that Photoshop presents to me in this dialog.
It would be so much easier to have a folder selection dialog with an address bar and quick access panel like this:
All other PS scripts that I've been digging around in use the Folder.selectDialog method to set file paths to a variable. Is there a reason for this? If not, then how can I instruct Photoshop the second style of folder navigation dialog?
It doesn't appear that Adobe supports this dialog as a folder selecting option.
There was a similar thread to this posted on the Adobe forums where a workaround was suggested:
https://forums.adobe.com/thread/1094128
The solution that was suggested is to use a saveDialog function instead of selectFolder. This gives you the folder dialog that we want, but comes with the downside of having to type a dummy name into the filename path. It also says "Save As" on the top of the dialog box, which is confusing.
Here's what was offered:
by lilsmokie on Nov 8, 2012 2:19 PM
var dskTop = Folder.desktop;
var dskPth = String(dskTop);
var newSpot = new File(dskPth+"/poop");
var selectedFolder = newSpot.saveDlg('Select Destination Folder');
var illFilePath = selectedFolder.path;
alert(illFilePath);
This opens the dialog at the desktop. Then put "poop" or whatever you
like in the text field. There the user can navigate to where ever.
When they it save illFilePath will have the folder path. Not perfect
but its close enough for me right now.
I've also discovered that I can set the starting location of the selectDialog by using selectDlg instead:
var outputFolder = Folder(app.activeDocument.path).selectDlg("Select a folder to output images to:");
This gives some control over the starting location so that the user doesn't have to click through a million dropdowns.
At the bottom of your first screenshot you can see the unput text area Folder: This PC. It works just like an address bar. You can type (or paste) something like \\server\work\folder\subfolder into this area and you get this folder ('subfolder' in this case) immediately.
On MacOS this dialog doesn't show the Folder: ... input area. But you can press Cmd-Shift-G and get the native system 'address bar' anytime.

How to save changes of a saved text file in VB.NET

I have a text editor that can open text files .txtand puts the text in a textbox. The user can also save the text to a .txt file.
How can the user save the changes of that text file that was saved recently?
Also, If the user opened a txt file how can the text editor change the text file to what the user changed?
Hope you understood that. Thanks in advance.
Since I don't know what you've done so far I will take this from the beginning...
For this you will need these components:
A SaveFileDialog
An OpenFileDialog
Three buttons (or menuitems), labeled: "Save", "Save As", "Open"
And I actually recommed using a RichTextBox instead of a regular TextBox.
.
To start, we put a variable in the code to know what file was saved before:
Dim LatestFile As String
Then, go to the properties of your Save- and OpenFileDialog and put this in the Filter field:
Text files (*.txt)|*.txt
Then you double-click the SaveFileDialog which should write the SaveFileDialog_FileOk event in your code. There you put:
LatestFile = SaveFileDialog1.FileName
RichTextBox1.SaveFile(SaveFileDialog1.FileName, RichTextBoxStreamType.PlainText)
And then double-click the OpenFileDialog, and enter this code:
LatestFile = OpenFileDialog1.FileName
RichTextBox1.LoadFile(OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)
And then for the buttons:
The "Open" button:
OpenFileDialog1.ShowDialog()
The "Save" button:
If Not LatestFile = "" Then
RichTextBox1.SaveFile(LatestFile, RichTextBoxStreamType.PlainText)
Else
SaveFileDialog1.ShowDialog()
End If
And the "Save As" button:
SaveFileDialog1.ShowDialog()
.
Hope this helps!
If I understood your question: you want your text editor application to detect changes that happened to the source text file that it is currently viewing to the user and if it detects a change, it should update its text box to display the latest file for the user.. am I right?
If that is the case, one way to do that is to use a Timer. Every time the timer tick event is triggered, you should check the date of the last modification to the file. If it is greater than the date that you have checked while opening the file for the first time, then the file had gone through some changes. Reload the file contents into the text box.
Another way (without using Timers) is to only check for the modification date once the application window is activated. Since the user will have to change the focus of the program to, say Notepad to do changes to the text file, then once the user returns focus to the Text Editor Application, use the Window Activate or Click event to check the file modification date.

Visual Basic read, split, modify .txt file

I'm using visual basic 2010 and im a new user. I have my project called mini database.
I want to export and display my text file in my program.
05655606515|Working|John
12345456445|Working|Alex
42348564041|Not Working|Jean
I have my 3 columns table and i want an unlimited rows. The rows and depends on how many lines are there in the text file.
The first column a text box, which i can modify what i like to enter on it.
The second column is a combo box which i can select if it is working or not.
And the third column is also a textbox which i can type the name of a user.
Please help me to have my project. Thank you stackoverflow!
Make a form with a textbox, combo box, and a second textbox.
Add a command button to save the data, one to show data, and possibly one to cancel and one to exit.
Fill the combobox with the appropriate items.
In the click handler for the save button, write the data to a file with "append".
The show data button can read the file display the text in a multiline text box or rich text box.

SAS EG dynamic text field

is there a text field control in SAS EG ?
how can i set the selected prompt value ( parameter) into a text field(header is ok too) that will show in the report?
sorry , im new in SAS , so those term im using might not be the correct one.
It is possible to add prompted value to a header.
First go to the Prompt Manager under View menu
Click Add to create a new prompt
Give your prompt a name eg. HeaderText and a display text like Text to display in report header. In the second tab, make sure it's of the type text.
Open the properties (NOT modify, but bottom option of the right click) of the report you want your text to be displayed in.
Go to the prompts screen and add the prompt you just created and click OK.
Now open the modify window of the report.
Go to the titles screen, disable Default Text and enter &HeaderText. in the text field.
Run your flow. It will prompt for a text and that text will be printed in the header.