Adobe Illustrator text selection different from other document - adobe

I am doing a copy-paste job from Word to Illustrator, whenever I double click on the word in the docx the whole word is selected like this
but when I try to double click in illustrator it leaves the first point out and selects the last "/" or selects the whole word but not just the middle part.
what could be the reason for that, and is there an easier way to do that

For simplest cases you can modify the selected range this way:
var sel = app.selection; // get the selection
sel.start += 1; // remove first letter from the range
sel.end -= 1; // remove last letter from the range
sel.select(); // select the new range
app.copy(); // copy selected text in clipboard
You can put the script into an action and assign some keyboard shortcut for the action.

Related

Emeditor : When using the extract feature : how to also remove the extracted contents (rows) from the source document?

Example : the file "A.txt" contains several rows with phrases :
This is a phrase
Bla keyword blabla
This is another phrase
Desired results :
in A.txt :
This is a phrase
This is another phrase
in B.txt :
Bla keyword blabla
Then I use the option "Find" keyword then I use "Extract". It extracts the correct rows in a new document (B.txt) but how to also remove the full row(s) containing the selected keyword in "A.txt" ?
This can be easily done with EmEditor. I have provided two methods.
Method 1
Select a keyword, right-click on the selection, and select Filter Out.
Click Extract All on the Filter toolbar.
Save as a new file name.
Method 2
Select a keyword, right-click on the selection, and select Filter.
Make sure Block Multiline Changes is disabled on the Filter toolbar.
Press Ctrl + A to select all text.
Press Delete.
Click the Abort button on the Filter toolbar.
I do the same thing a lot in EmEditor and using only the keyboard, this is the quickest way I know.
Here are my steps:
Highlight the search string and open the Find dialogue Ctrl + F
Alt + T to Extract the lines into a new document/tab
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Go back to the original source document Ctrl + Tab
Re-open the Find dialogue Ctrl + F
Bookmark the lines Alt + B
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Delete the bookmarked lines Ctrl + Shift + Backspace
Steps 3 and 7 can be skipped if using the mouse to select the original source document. I just haven't figured how to activate it with the keyboard while the Find window is still open.

Cells in Jupyter notebooks

I am trying to parse a pdf using PyPDF2 in a Jupyter notebook. Below is how I would like to write the different parts of the code, that is, the extract text statements in one cell and the RegEx in a new cell. However, if I separate the two pieces of code as below, the RegEx only runs through the last page of the file and not through the whole file (12 pages). Why does this happen? I would really like to use different cells.
import PyPDF2
import re
file = open(r'file.pdf', 'rb')
doc = PyPDF2.PdfFileReader(file)
#print(doc.getNumPages())
#new cell
for i in range(0, 12):
page = doc.getPage(i)
text = page.extractText()
#print(text)
#new cell
doc_re = re.compile(r'S\d+_\d+', re.IGNORECASE)
result = doc_re.findall(text)
print(result)
Each time you run your for loop, you're resetting the value of text by using text = page.extractText()
The RegEx is running on what you give it, which is text. Even though your loop runs over 12 pages, the second cell of code receives the final value of text (which is whatever you assign it to be on the last iteration of the loop).
You can either move the code from your second cell inside of your for loop, or a better option would be to add each page's text to text.
So, turning text = into text += should solve your problem.

How can I show the data with comma(,) in drop down box on window?

I have written the program to show all the data on window but stuck in the case for showi a single record with comma(,) in drop down box. Let me share codes what i tried.
DEFINE TEMP-TABLE tt_seq_report
FIELD npai_output_expression AS CHARACTER FORMAT "X(50)".
/* Followings are written inside the drop down box using progress app builder */
/* ON VALUE CHANGED OF coCombo-4 Part Type(Label Name) */
DO:
DEFINE VARIABLE cPartTyp AS CHARACTER NO-UNDO.
CREATE tt_seq_report.
ASSIGN
tt_seq_report.npai_attribute_expression = "22+++,56-".
coCombo-4:ADD-LAST(tt_seq_report.npai_attribute_expression).
END.
When I run the window and select the drop down box then i can see the value upto before comma(,) i.e 22+++ but it should show the full value like 22+++,56-. May I get any help regarding this?
You can set the combo-box'es DELIMITER property to any other character. Comma is just a default.
"Delimiter character can have any ASCII value from 1 to 127. The default delimiter is a comma."

How do I advance to the next occurrence of a variable in R Studio IDE

When I highlight any string of text in the R Studio console a rectangle is drawn around all other occurrences of this same string of text. How do I advance to the next occurrence of this arbitrary string of text? I'd like the keyboard shortcut.
CTRL-F3 is the closest shortcut I know. This takes the selected string of text, drops it into the Find dialog and jumps to the next occurrence (keep pressing CTRL-F3 to cycle through)
If you would like to move to the next occurrence of a word/variable and select it while also keeping the original selected, this command exists but does not have a default shortcut assigned to it.
The command is called 'Find and add next' (or 'Quick Add Next' in older versions). You can assign a shortcut to it by going into Preferences -> Code -> Modify_Keyboard_Shortcuts. I use Alt+Cmd+Right (on a Mac) as that is an unassigned key binding.
You can see bellow I have used the command twice to select three of the four instances.
On a Mac, I use command+f to call Find with a selected string and then use control+g to move onto the next match.
This needs to be over 30 characters, but only needs 2:
F3

How do I run the same piece of code for multiple text inputs without using select case?

I have eight aspx text inputs labelled txtBoookingId1, txtBookingId2 etc etc. I have a sub which handles eight buttons clicks as the code is more or less the same for each. I have it so it knows which one is pressed. I want to run "booking = System.Text.RegularExpressions.Regex.Replace(txtBookingId2.Text.Trim, "[^0-9.]", "")" to trim off any letters but I want the txtBokingId2 part to be the correct one based on which button was clicked.
Is there an easier way of doing this than using a Select with eight cases and the same line of code in each with only the bolded above changed slightly? I tried having a string "Dim txt As String = "txtBookingId" & btnPressed.ToString" (which would give txtBookingId1, txtBookingId2 etc based on button then using that in place of txtBookingId2 but it's not valid code as there isn't an text input named "txt".
Code decides which button is clicked based on where CommandArgument=1,2,3 in the text input etc

Resources