I've tried several guides, but i haven't really found that any of them fit my purpose.
The problem seems simple enough, i want to create a dynamic link based on a variable.
I've tried inserting a Hyperlink with temp text and link, replacing the text within the "" brackets, with a MergeField corresponding to the variable.
Whenever i test it, the variable does not register. The syntax is as follows :
{ HYPERLINK "www.staticurl/{MergeField varurl}" }
Does anyone have any suggestions on why this variable does not register?
Thanks in advance!
Related
I'm trying, to wrap my head around Touchosc and script based on LUA 5.1.
I have a number of labels, called song0, song1, song2, and so on. I'm trying to set different values in these, using
local text = 'Smoke On The Water'
for i = 1, 2 do
self.children.pager1.children.main.children.song[i].values.text = text
end
but that gives me an error.
:-) I do need help.
Finn
Since you haven't provided the actual error, it's difficult to say what the problem is, but if I have to venture a guess, then try replacing ...children.song[i].values... with ...children["song"..i].values.... Since there is no table song, you just need to generate dynamic field names.
I'm using razor for the engine and need some clarification on displaying some text directly after a variable (without any space).
Example Code:
<p>#variable some text</p>
The above code will work just fine, but what if I wanted to have some text displayed directly after it without combining it into the variable and without any space between them.
Obviously this doesn't work:
<p>#variablesometext</p>
You need to use parentheses:
<p>#(variable)sometext</p>
I'm having a little trouble trying to figure out how to search all the text in my RichTextBox and delete everything between the parentheses (including the parentheses). I have a lot of files with different comments wrote in the parentheses that may have different text in them.
Example : This is my text in the text box (AS YOU CAN SEE HERE). I am wanting to be able to read the entire text box (This would be another comment) and delete the out.
Result: This is my text in the text box. I am wanting to be able to read the entire text box and delete the out.
The rich text box are usually longer files than just a couple lines. Any help would be gratefully appreciated.
You can use a regular expression for this:
Regex r = new Regex("\(.+?\)");
If you are using a richtextbox or a textbox:
rtb.Text = r.Replace(rtb.Text,"");
You can do this without reading the file into the richttextbox:
string filetext = File.ReadAllText("file.txt");
filetext = r.Replace(filetext,"");
File.WriteAllText("file.txt",filetext);
Or in one line:
File.WriteAllText("file.txt",r.Replace(File.ReadAllText("file.txt"),""));
You can loop all files in a directory:
foreach(string file in Directory.GetFiles(targetDirectory)
File.WriteAllText(file,r.Replace(File.ReadAllText(file),""));
I have an agent that takes a copy of a template document and puts in values from a text file.
I am running into a problem when adding a hyperlink to a field programmatically, If I just add the text (e.g. http://www.google.com) there is no hyperlink just plain text. If I add the text manually, by editing the document just adding the address works fine and is clickable.
I have tried creating a rich text object then adding that to the field but that doesn't work either :(
Set rtItem = New NotesRichTextItem( doc, "link" )
Call rtitem.AddNewLine( 1 )
Call rtItem.AppendText ("http://www.google.com")
doc.AppendItemValue "Details", rtItem
To be clear, I'm looking for a way to append a clickable hyperlink to a field using lotusscript. Any help would be greatly appreciated.
EDIT:
Upon further inspection if I generate a document with a link in the text field and save it (programmatically using doc.save) it saves as plain text, as soon as I then go into this document and do a manual save the plain text turns into a link just fine. Could something be wrong with how I am saving?
If (Not doc.save(True,False,True)) Then
Msgbox("Document could not save")
End If
It does work the way you tried in your code with just "AppendText". But, the link works only if the document is in read mode and client property "Make Internet URL ... into Hotspots" is set.
UPDATE:
AppendItemValue doesn't work for RichTextItems.
Append the link direct to your field "Details" or if it doesn't exist then create it. Your code should look like this:
Dim rtItem As NotesRichTextItem
If doc.Hasitem("Details") Then
Set rtitem = doc.Getfirstitem("Details")
Else
Set rtitem = doc.Createrichtextitem("Details")
End if
Call rtitem.AddNewLine( 1 )
Call rtItem.AppendText ("http://www.google.com")
I'm working in a Rails 3.1.8 app and I'm having a problem creating a Twitter share button that produces the text I want. Here is the erb code for the button:
Tweet
This button appears on a page that contains content produced by a particular user. Let's call the user "sam". The text this code produces to be shared on Twitter is:
[some_text] [url of current page] via #sam
I would like to remove the "via #sam", but I cannot figure out how. If I explicitly set data-via I can change the user that the "via" phrase refers to, but I cannot make it disappear.
This support page suggests that omitting the data-via tag should do the trick, but I have found that it does not.
I've searched around the app to try to find a place where this parameter is being set, but I haven't found anything. However, as I'm pretty green with Twitter stuff, I may not be searching for the right thing.
Thanks in advance for your help, and do let me know if I can provide additional info.
ADDENDUM: I've tried add setting data-via to various values, including false, "false", and "", as well as appending ?via= and analogous values to the share URL. Each of these attempts resulted in a bogus via phrase (e.g. "#false"), or a default to "#sam".
Maybe you have an old version of the Javascript being included or cached.
Taking examples from https://dev.twitter.com/docs/tweet-button works as expected when omitting the data-via attribute.
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Working example: http://jsbin.com/uxopur/2/