Howdy, I'm new to Textpad.
v4.7.1
Assuming several bookmarks spanning multiple documents...
Is there any method to clear all bookmarks (from among all loaded documents) without manually selecting each document first?
Clear all bookmarks (from among all loaded documents)
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 4
- Joined: Sun Oct 05, 2003 6:18 pm
I've written a program that does what you want, though it's not particularly efficient. (You may need to tweak the "sleep" statements if you are dealing with a lot of large files.)
How to use it:
1. Download AutoIt3.exe from http://www.hiddensoft.com/autoit3/
2. Save the following code in a file such as "unBookmarkAll.au3"
3. Create a user-defined tool (Configure/Preferences/Tools)
that points to the program AutoIt3.exe and takes parameter "unBookmarkAll.au3"
Note: Alternativly, you can download the entire AutoIt package (under 600 KB) to compile my script into a standalone executable. But the method described above allows you to easily tweak the script if you need to.
How to use it:
1. Download AutoIt3.exe from http://www.hiddensoft.com/autoit3/
2. Save the following code in a file such as "unBookmarkAll.au3"
3. Create a user-defined tool (Configure/Preferences/Tools)
that points to the program AutoIt3.exe and takes parameter "unBookmarkAll.au3"
Note: Alternativly, you can download the entire AutoIt package (under 600 KB) to compile my script into a standalone executable. But the method described above allows you to easily tweak the script if you need to.
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clear all bookmarks from ALL documents in the active TextPad instance ;
; Simply cycle thru each file, and call "Clear all bookmarks" each time ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; AutoIt v3 script <www.hiddensoft.com/autoit3/> for TextPad 4.7.1
; Philip Gump - 5 October 2003 - philipgump@yahoo.com
;;; First, Determine the number of files ;;;
$titles = WinGetText("TextPad - ","") ; get list of files & toolbars...
; I'll ASSUME each file path contains ":\" so I won't count toolbars.
$count = 0
While StringInstr($titles, ":\") <> 0
$count = $count + 1
$titles = StringTrimLeft($titles, StringInstr($titles, ":\"))
WEnd
;;; Now cycle through the files (returning to original at end) ;;;
SendSetDelay(0)
For $i = 1 to $count + 1
Send("^+{F2}") ; Ctrl+Shift+F2 "Clear all bookmarks"
Sleep(5) ; pause 5 milliseconds for operation to complete
Send("{CTRLDOWN}") ; Loop is needed due to the way that
For $k = 1 to $i ; ctrl+tab (cycling thru files) works.
Sleep(1) ; pause 1 ms in case switching between large files
Send("{TAB}") ; It cycles you to the last active tab instead
Next ; of simply the next tab...or something
Send("{CTRLUP}") ; like that!
Next
; End of Script
-
- Posts: 4
- Joined: Sun Oct 05, 2003 6:18 pm
5 years on and I've found this very useful. TextPad still doesn't support multiple documents very well with bookmarks.
I've updated your AutoIt script to AutoIt3 compatible. Hope you don't mind.
Cheers,
Barry.
I've updated your AutoIt script to AutoIt3 compatible. Hope you don't mind.
Cheers,
Barry.
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clear all bookmarks from ALL documents in the active TextPad instance ;
; Simply cycle thru each file, and call "Clear all bookmarks" each time ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; AutoIt v3 script <www.hiddensoft.com/autoit3/> for TextPad 4.7.1
; Philip Gump - 5 October 2003 - philipgump@yahoo.com
;
; Updated to AutoIt3 functions
; Barry Everett - 11 December 2008 - POZ Ltd (www.poz.co.im)
;
; TextPad->Configure-Preferences; add a new Tool, command pointing to the AutoIt3.exe, and parameter to this file.
;
AutoItSetOption ( "WinTitleMatchMode", 2 )
;;; First, Determine the number of files ;;;
$titles = WinGetText("TextPad - ","") ; get list of files & toolbars...
;MsgBox(0, "Text read was:", $titles )
; I'll ASSUME each file path contains ":\" so I won't count toolbars.
$count = 0
While StringInstr($titles, ":\") <> 0
$count = $count + 1
$titles = StringTrimLeft($titles, StringInstr($titles, ":\"))
WEnd
AutoItSetOption ( "SendKeyDelay", 1 )
;;; Now cycle through the files (returning to original at end) ;;;
For $i = 1 to $count + 1
Send("^+{F2}") ; Ctrl+Shift+F2 "Clear all bookmarks"
Sleep(5) ; pause 5 milliseconds for operation to complete
Send("{CTRLDOWN}") ; Loop is needed due to the way that
For $k = 1 to $i ; ctrl+tab (cycling thru files) works.
Sleep(1) ; pause 1 ms in case switching between large files
Send("{TAB}") ; It cycles you to the last active tab instead
Next ; of simply the next tab...or something
Send("{CTRLUP}") ; like that!
Next
; End of Script