Example Scriplets

Here are some examples of some useful Lotus Notes Scriptlets – Keeping them in a Bookmark folder allows them to be used as developer tools whenever you need them

Show me the session cookie – (this works on any website)
javascript: var temp=document.cookie;alert(temp.replace(/;/gi,”\n”)+’\n\nLength=’+document.cookie.length)

Open ezScan from a URL (assumes URL in the format http://server/path/db.nsf/viewname/docUNID – no ? opendocument)
javascript: var sTemp=location.pathname; var loc=”scanez://YOURSERVERNAME/”+sTemp.substring(1, sTemp.indexOf(“.nsf”)+5)+”0/”+sTemp.substring(sTemp.lastIndexOf(“/”)+1, sTemp.length); alert(loc); void(0);

Open a specific document by Key (enter MRON-8QDL59)
javascript:%20a=prompt(‘Blog Number’,”);%20location.href=’http://www.nostradominus.com/mdroden/nd.nsf/d6plinks/’+a

Open a user’s document in the NAB (assuming you are viewing a Lotus Notes webpage)
javascript:%20a=prompt(‘Enter the User Shortname’,”);%20location.href=’/names.nsf/($Users)/ ‘

Show the current view in XML format (assuming the URL in the format http://server/path/db.nsf/viewname? openview)
javascript: var sTemp=location.pathname; var loc=”/”+sTemp.substring(1, sTemp.indexOf(“.nsf”)+5)+sTemp.substring(sTemp.lastIndexOf(“/”)+1, sTemp.length)+”?ReadViewEntries”; location.href = loc; void(0);

Show the current view in JSON format (assuming the URL in the format http://server/path/db.nsf/viewname? openview)
javascript: var sTemp=location.pathname; var loc=”/”+sTemp.substring(1, sTemp.indexOf(“.nsf”)+5)+sTemp.substring(sTemp.lastIndexOf(“/”)+1, sTemp.length)+”? ReadViewEntries&OutputFormat=JSON”; location.href = loc; void(0);

Search the current view (assuming the database is Full Text indexed and search forms are enabled)
javascript:%20a=prompt(‘Enter the Query’,”); var sTemp=location.pathname; var loc=”/”+sTemp.substring(1, sTemp.indexOf(“.nsf”)+5)+sTemp.substring(sTemp.lastIndexOf(“/”)+1, sTemp.length)+”?searchview&Query=”+a; location.href = loc; void(0);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s