Inmagic Forums
Inmagic Forums
Scripting
Useful jscript to edit text strings copied into for example KeyWords field|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
This script can be used to edit a text line that has been put/copied into a field and, as you save the record, insert an Entry Mark instead of “comma”, “semicolon”, "carriage return" or “line feed” in for example a KeyWord list. Could be altered/developed for other purposes.
// Use replace options to edit text boxes with unwanted text/appereance: // replace(/; /g, "\u001F") replaces semicolon + space to Entry Mark Separator // replace(/\, /g,"\u001F") replaces comma + space to Entry Mark Separator // replace(/\r/g,"\u001F") replaces Line Feed (LF) to Entry Mark Separator // to replace different signs at the same time put an paranthesis around the sign(s) you want to replace // In the following jscript, semicolon + space, comma + space, semicolon, comma, carriage return and line feed are replaced with an Entry Mark Separator. function onRecordSave() { var KW1 = Form.boxes("KW").content; var KW2 = KW1.replace(/(; )|(\, )|( Form.boxes("KW").content = KW2; } Jscript created by Nils-Erik Engström, Falun, Sweden NEEngstrom |
|||
|
How come you're using \u0001F instead of the Application.entrySeparator constant?
Peter Tyrrell, MLIS Senior Consultant Andornot Consulting Inc. http://www.andornot.com/about/developerblog |
||||
|
I earlier asked for help to make a script about changing "comma" to "Entry Mark" but got no responses.
The only reson why I used \u0001F is that I saw some correspondance where \u0001F were used to search for Entry Marks. I agree that it would be as good to use Application.entrySeparator instead. This means that function onRecordSave() { var KW1 = Form.boxes("KW").content; var KW2 = KW1.replace(/(; )|(\, )|( Form.boxes("KW").content = KW2; } would function as gtood as my first distributed script. NEEngstrom |
||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Inmagic Forums
Inmagic Forums
Scripting
Useful jscript to edit text strings copied into for example KeyWords field
