|
FairyHand Scripts
If
you have written an interesting script and would like to share it with other
FairyHand users, please send it to feedback@natasoft.com
as a text file attachment. Use the File/Export function to create the text file.
We will publish your scripts after reviewing them. Please note that any script
sent in any format other than ANSI Text-Only (including .FHD format) will be
ignored. If you do not want your name and/or email address to be published,
please let us know.
WARNING !!! THE FOLLOWING SCRIPTS ARE PROVIDED FOR EDUCATIONAL PURPOSES ONLY. They are provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or noninfringement. The entire risk arising out of use or performance of any FairyHand script remains with you.
IF YOU DO NOT FULLY AGREE WITH ALL THE TERMS STATED ABOVE , DO NOT USE FAIRYHAND.
WE STRONGLY RECOMMEND THAT YOU DOWNLOAD AND READ THE FAIRYHAND MANUAL ENTIRELY BEFORE RUNNING ANY SCRIPT. TEST AND DEBUG YOUR SCRIPTS USING SAMPLE (BOGUS) DATA!
Opening
any selected URL in a separate window using Microsoft Internet Explorer
Renaming
files in Explorer using file names extracted from a text file
How to change font attributes
in Wordpad ?
How to extract email
addresses from a contact Web page ?
Opening any selected URL in a separate window using Microsoft Internet Explorer
Select any URL in Microsoft Internet Explorer then drop the following FairyHand item (it's one single item!) over the page window's title bar to open the selected URL in a separate browser window. This item is useful to open any URL directly when the URL is not clickable or when using a search engine : If you do a search on Altavista, for example, the linked result pages don't open directly. Your request is first processed by the search engine's servers which will then redirect you to the actual result page (did you ever pay attention to the long URL in your address bar when you click on a result URL? What are these codes anyway?).
Open selected
URL in a new window -=>
<CTR-P>c<CTR-R>
<WT001></4>
<CTR-P>n<CTR-R>
<WT001></2>
<TAB-C>
<SHF-P><INS-C><SHF-R>
<ENT-C>
Renaming files in Explorer using file names extracted from a text file
A. J. - who prefers to stay anonymous - emailed us the following message and script. We recommend all FairyHand users to try it out and study it. It illustrates many useful instructions which will surely help you write your own scripts. All thanks to A. J. and to the growing FairyHand community !
----------
Hi Natasoft!
[snip] I had a CD recently, loaded with Pink Floyd mp3 songs, over 250 :) Unfortunately, the mp3 files were named like trck0001.mp3, trck0002.mp3.. instead of using the song's name to identify each file. Hopefully, I had all albums titles stored in separate text files on the CD.. I's planning to use the CD in my car, but found it really useless without the songs title (I have a cool Grundig mp3 player with CD-Text feature ;-).. What was I supposed to do? Rename the files manually using copy/paste? Frustrating when you have a "computer" ?! Then I remembered that nice little automate-anything proggy I d/loaded from the net a few days ago.. read the manual.. a few hours later, I had my first script running and all my pinkie files renamed correctly! Thanks!!
Now that I'm more familiar with your cool beastie, I'm planning to use it to automate my backup and maintenance tasks. I will also use it to automate tasks in my web browser and chat programs !
[snip]
Thank you for providing this great tool!
A. J.
[snip]
----------
To test this script, you need to do the following :
1) Select/copy the following text and paste it in a new Notepad window. Save the file using any name you want (e.g. album.txt).
1.Cluster One 5:58
2.What do you want from me 4:21
3.Poles Apart 7:04
4.Marooned 5:28
5.A Great Day For Freedom 4:18
6.Wearing The Inside Out 6:48
7.Take It Back 6:12
8.Coming Back To Life 6:19
9.Keep Talking 6:11
10.Lost For Words 5:14
11.High Hopes 8:31
2) Select/copy the following text and paste it in a new Notepad window. Save
the file using any name you want (e.g. renamescript.txt).
Item 1 : Position
the caret at top of text doc in Notepad -=><CTR-P><HOM-C><CTR-R>
Item 2 : Position caret before the 1st dot (scan left to right) -=><GO2KW><+001>.
Item 3 : Skip the dot -=><RAR-C>
Item 4 : Select line from current caret position to 1st character -=><SHF-P><HOM-C><SHF-R>
Item 5 : Clear selection and move caret to end of line -=><DEL-C><END-C>
Item 6 : Position caret before first white space found while scanning from left
to right (we must add one space after <-001>!!!) -=><GO2KW><-001>
Item 7 : Select line from current caret pos. to 1st character (new file name)
-=><SHF-P><HOM-C><SHF-R>
Item 8 : Copy to clipboard and wait for 500 ms -=><CTR-P>c<CTR-R><WT001></2>
Item 9 : Move caret to beginning of next line -=><DAR-C><HOM-C>
Item 10 : Switch from Notepad to Explorer -=><ALT-P><WT001></2><TAB-C><WT001><ALT-R><WT001></2>
Item 11 : Press F2 to rename selected file in Explorer. Wait for 500 ms -=><F02-C><WT001></2>
Item 12 : Move caret in file name (in Explorer) 4 positions left to skip ".mp3"
-=><LAR-C><LAR-C><LAR-C><LAR-C>
Item 13 : Select old file name in Explorer (without the dot extension) -=><SHF-P><HOM-C><SHF-R>
Item 14 : Replace selection with new file name from clipboard (paste). Wait
500 ms -=><CTR-P>v<CTR-R><WT001></2>
Item 15 : Validate and wait 500 ms -=><ENT-C><WT001></2>
Item 16 : Select next file name in Explorer -=><DAR-C>
Item 17 : Switch back to Notepad -=><ALT-P><WT001></2><TAB-C><WT001><ALT-R><WT001></2>
Item 18 : Proceed from item #2 -=><PROCD><-016>
3) Open FairyHand. Use the File/Spawn command to open a new FH list (if needed).
4) Use the File/Import command and select the script file you've just created (renamescript.txt).
5) Open Explorer. Create a new test folder. Now you need to have 11 files with the mp3 extension in your new folder. Either copy/paste any 11 mp3 files or select any other 11 files on your hard disk and copy/paste them in the new test folder. Rename the file extension manually if needed. Your test folder should have 11 files with the .mp3 extension - any size will fit for this simulation.
6) In FairyHand, choose Options/Preferences and make sure that :
a- "...append
Nothing" is selected.
b- "Proceed and process next item" is checked.
c- "Response tuning" is set to 5
d- "WT delay tuning" is set to 0
Note : You may need to change options (c) and (d) if you have a slow PC !
Close the FairyHand Preferences dialog box.
7) Make sure that your test folder in the Explorer window, your Notepad album.txt window and your FairyHand list are opened and visible on the screen : Tile the Notepad window and the Explorer folder window horizontally keeping your FairyHand list in the upper or lower right corner of your screen.
Note : In Explorer, choose View/List or View/Details. You must also make sure that the .mp3 extension is displayed (this option is available in Folder Options)
8) To run the script, do the following :
a- Click
inside the Notepad window to activate it.
b- Select the first file name in Explorer.
c- Drag the first FairyHand item and drop it inside the Notepad window.
The script will start renaming the files. Once the last file is renamed correctly, move the mouse pointer inside the boundaries of the running FairyHand list to stop the script execution.
How to change font attributes in Wordpad ?
Dropping the following FairyHand item inside the font name edit box in Wordpad will display the selected text in Arial (Western), size 20, italic.
<END-C><SHF-P><HOM-C><SHF-R>
Arial (Western)
<TAB-C>20<CTR-P>i<CTR-R>
Notes : If you don't have Arial (Western) - exact font name - installed on your system, you may need to change the font name. Modify this example to create other formatting styles.
How to extract email addresses from a contact Web page ?
Many web sites offer a contact web page that lists email addresses of persons and/or departments you may wish to contact. Suppose you want to send a BCC for each person whose email address is listed on a contact Web page - to send a press release for example. If you need to BCC three or four people, you may copy their addresses and paste them manually in your email software. But if the page contains 30 persons for example, it may become frustrating to copy/paste each address manually ! You may also need to contact many companies... so here's a FairyHand script that will do the job for you automatically.
Item #1
-=><OPENF><notepad.exe><WT001><PROCD>
Item
#2 -=><ALT-P><TAB-C><WT001></4><ALT-R><WT001></4><PROCD>
Item
#3 -=><TAB-C><APP-C><WT001></2>t<WT001></4><PROCD>
Item
#4 -=><ALT-P><TAB-C><WT001></4><ALT-R><WT001></4><PROCD>
Item
#5 -=><PROCD><CTR-P>v<CTR-R><WT001></4><GO2KW><-001>:
Item
#6 -=><PROCD><WT001></4><DEL-C><BCK-C><BCK-C><BCK-C><BCK-C><BCK-C><BCK-C><END-C>;<HOM-C><BCK-C><CTR-P><ALT-P><END-C><ALT-R><CTR-R><ENT-C>
Item
#7 -=><PROCD><*002>
Notes : Select/copy the code lines above and paste them into a new Notepad window. After pasting the lines in Notepad, press Enter (or Return) once on the keyboard to add a blank line at the end of the Notepad document (after <*002>). Do not make any other changes in Notepad ! Save the Notepad text file then import it into an empty FairyHand list. You should have 7 items in your new FairyHand list.
This script was tested under Windows 98 SE, using Microsoft Internet Explorer 6 to display the contact Web page. If you are using a different system or software, you may need to modify the script.
To test
your script, connect to the following web page :
http://www.informationweek.com/contactus.htm
When the page is displayed, scroll down to the first email address (Editor-In-Chief). Click on the first email link without releasing the left mouse button. While keeping the mouse button pressed, move the mouse to display a stop sign cursor (a barred circle) then release the mouse button. Click once on the background of the web page to remove the selection from the first email address. You're ready to drop the first FairyHand item ! When the last email address is extracted, move the mouse pointer inside the FairyHand list window to abort the process. Once all the addresses are listed in Notepad, you may select/copy them and paste them in the CC or BCC edit field of your email client !
© 1998-2002, by Patrick Aoun. All rights reserved.