How to append into field - append

How can I append a text into a text field. I tried something like:
on mouseUp
append "Once again" into "field display"
end mouseUp
Where "display" is a Scrolling field.
Thanks.

Try:
Put "hello" after field "display"

If you want to append to a specific line, and since you have a scrolling field this may be what you really asked for:
put space & "Hello World" after line 3 of fld "yourScrollingField".
Know also that you could:
put space & "Hello World" after word 3 of line 3 of fld "yourScrollingField".
Check out all three chunk keywords, "before", "into" and "after" in the dictionary. Chunk expressions permit exquisite control of text down to the character level.

Or...
put cr & "This is a new line of text." after field "display"
Why?
"after" is quite literal, equal in effect to "&".

Related

How to include function text in a formula?

This is probably a very simple question, but i'm trying to write a formula which will display text depending on the value that is being run.
However, the text i require has the word "Floor" in it which is a function, therefore when i save the formula it warns me saying There is an error in this formula. Do you want to save it anyway?
Is there a way i can include the word Floor in the text, such as putting '' around the word?
For example
IF {database.column} = 3 THEN "3rd Floor"
try this, i think CR is expecting an Else statement
IF {database.column} = 3 THEN
"3rd Floor"
else ""
I found the issue, it was the fact that i had a line break in it without specifying it with Chrw().
Right-Click on feild then Formate Object & insert formula in Display string
IF {database.column} = 3 THEN '3rd Floor'

[LibreOffice Writer]: How to create empty line space after every period in a paragraph in LibreOffice Writer?

How to create empty line space after every period in a paragraph in LibreOffice Writer as like below:
Original Paragraph:
aaaaaa.bbbbb.cccccc.ddddddd.
Expected Paragraph:
aaaaaa.
bbbbb.
cccccc.
ddddddd.
If it is possible as per my expectation using LibreOffice Writer means guide me to get the above output. Thanks in advance.
Position your cursor at the start of the paragraph in question. Then in the Find & Replace dialog...
Check Regular expressions under "Other options"
Set Find: to \.
Set Replace: to &\n\n
Click the "Replace" button repeatedly until the paragraph changes are complete (Note that the first click will likely just position the cursor at the first '.')
For the whole document, do the same except position your cursor at the start of the document and click the "Replace All" button rather than "Replace".

Is there a function or a method to add " , " after every row in VSC?

I have a .json file which is about 600+ lines and it looks like this:
{data0..}
{data1..}
{data2..}
To use it i need to add [ before and ] after to make it an array (no problem)
but i need to add " , " after every row. Is there a function/method to do that faster than manual typing?
Every object contain data in it.
Or anything to make it readble?
Alternatively, and simpler,
Ctrl-A to select all.
Shift-All-I to put a cursor at each line end.
Type your ,.
Press Ctrl-H for the Search-Replace window
In the first line type \n which means new line and make sure the regular expressions button is pushed - it's 3rd in the row and looks like this: .*
In the second line type ,\n - to replace new line with a comma followed by a new line
Push the "replace all" button
Notice: it assumes every JSON object occupies strictly single line

VBA Label formatting

I am using label from tool box control to place and write a default text to my form. However I want to break line and I don't know how to do it.
I don't believe writing a paragraph on the caption field is the right way to customize my form, is it? Am I missing something?
When you are writing your text into your label press (Shift+Enter) to add a return carriage.
You could use something like the vbCrLf constant to update the caption by code:
Label1.Caption = "New" & vbCrLf & "caption"
You can use 'vbnewline' to move to the next line in the field, just make sure your label is sized properly so it will show.
Example: string = "Text" & vbnewline & "text"
will read:
Text
text

Applescript for inserting hyperlink into MSWord comment

I'm trying to add a hyperlink object inside a Word comment.
To create a new comment in the active document I'm using this piece of script:
tell application "Microsoft Word"
set tempString to "lorem ipsum"
make new Word comment at selection with properties {comment text:tempString}
end tell
but now I'm not able to get a reference to the new created comment for use it with the command "make new hyperlink object".
Thanks for any suggestions.
Riccardo
I don't think you can work with the object returned by make new Word comment (at least not in this case), and you have to insert a unique, findable string then iterate through the comments:
tell application "Microsoft Word"
-- insert a unique string
set tempString to (ASCII character 127)
set theComments to the Word comments of the active document
repeat with theComment in theComments
if the content of the comment text of theComment = tempString then
set theRange to the comment text of theComment
-- you do not have to "set theHyperlink". "make new" is enough
set theHyperlink to make new hyperlink object at theRange with properties {text range:theRange, hyperlink address:"http://www.google.com", text to display:"HERE", screen tip:"click to search Google"}
insert text "You can search the web " at theRange
exit repeat
end if
end repeat
end tell
(edited to insert some text before the Hyperlink. If you want to insert text after the hyperlink, you can also use 'insert text "the text" at end of theRange.).
So for adding text, it was enough to use "the obvious" after all.
[
For anyone else finding this Answer. The basic problem with working with Word ranges in Applescript is that every attempt to redefine a range in the Comments story results in a range that is in the main document story. OK, I may not have tried every possible method, but e.g., collapsing the range, moving the start of range and so on cause that problem. In the past, I have noticed that with other story ranges as well, but have not investigated as far as this.
Also, I suspect that the reason why you cannot set a range to the Word comment that you just created is because the properties of the Comment specify a range object of some kind that I think is a temporary object that may be destroyed immediately after creation. SO trying to reference the object that you just created just doesn't work.
This part of the Answer is modified...
Finally, the only other way I found to populate a Comment with "rich content" was to insert the content in a document at a known place, then copy its formatted text to the comment, e.g. if the "known place is the selection, you can set the content of theComment via
set the formatted text of the comment text of theComment to the formatted text of the text object of the selection
If you are using a version of Word that supports VBA as well as Applescript, I don't really see any technical reason why you shouldn't invoke VBA to do some of these trickier things, even if you need the main code to be Applescript.
]
Finally I got a solution here:
https://discussions.apple.com/message/24628799#24628799
that allowed me to insert the hyperlink in reference with part of the comment text, with the following lines, if somebody in the future will search for the same:
tell application "Microsoft Word"
set wc to make new Word comment at end of document 1 with properties {comment text:"some text"}
set ct to comment text of wc
set lastChar to last character of ct
make new hyperlink object at end of document 1 with properties {hyperlink address:"http://www.example.com", text object:lastChar}
end tell