[jawsscripts] Can some one help me to modify the folowing script to make it better?

  • From: kaveinthran <kavein2211@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Wed, 14 Dec 2011 21:58:31 +0800

Hi friends,

I am planning to write a script that can help me to save text on the 
clipboard with a spesific name and reproduce it by selecting the name in 
a standard listview

I have successfully write some code for it! but, not complete  yet, Can 
some one help me on it by repairing the script?

---the code starts here

Script InputTextName () ;ctrl+e
var
int input, ;for the text name dialog
string text, ;variable to store the text name
string fileSave ;to save the clipboard text file
let fileSave = "c:\\"+GetJAWSUserName ()+"\\"+text+".txt"
let input = InputBox ("enter a name for the text which is on the 
clipboard", "Store text name", text)
if input == 1 then
IniWriteString ("text store", text, text, "clipboard text.ini")
IniWriteString ("", "", GetTextFromClipboard (), fileSave)
SayUsingVoice (vctx_message, text+"Saved", ot_string)
else
SayString ("cancelled")
endif
EndScript

Script list () ;ctrl+l
var
int list ;for the text name list
if StringIsBlank (IniReadSectionKeys ("text store", "clipboard 
text.ini")) then
SayUsingVoice (vctx_message, "there is no saved text", ot_string)
else
let list = DlgSelectItemInList (IniReadSectionKeys ("text store", 
"clipboard text.ini"), "select a text to reproduce", 1)
if list == 0 then
SayString ("cancelled")
else
loadTextStore (list)
endif
endif
EndScript

Void Function loadTextStore (int textStore)
var
string load ;to load the saved clipboard text
;I have no idea, could any one give some
EndFunction

Script ClearClipboardText () ;Alt+Shift+l
var
int list, ;for the clear text dialog list
string fileSave ;The location where the text had been saved
let list = DlgSelectItemInList (IniReadSectionKeys ("text store", 
"clipboard text.ini"), "select a clipboard text to delete", 1, 1, 
"delete"+"cancel", -1)
if list == 0 then
SayUsingVoice (vctx_global, "cancelled", ot_string)
else
IniRemoveKey ("text store", "script", "clipboard text.ini")
DeleteFile ("script.txt")
endif
EndScript

---The codes end here

I hope some one can come up with an idea!

Thanks in advance!
__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts:

  • » [jawsscripts] Can some one help me to modify the folowing script to make it better? - kaveinthran