text 1 of text document "..."


tell application "BBEdit"
	activate
	replace "ä" using "auml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
	replace "Ä" using "Auml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
	replace "ö" using "ouml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
	replace "Ö" using "Ouml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
	replace "ü" using "uuml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
	replace "Ü" using "Uuml;" searching in text 1 of text document "f_action_main.html" options {search mode:literal, starting at top:true, wrap around:false, backwards:false, case sensitive:true, match words:false, extend selection:false}
end tell

It is a recorded macro in Bbedit and confuses me, because it focus on a special document and I don’t know if I can use it for any other document. So I thought:
I would like to turn this script to a more general drag and drop script for replacing german special chars of any document I drop over, but I don’t know how to request it. All I know is, that I have to change the 'searching in text 1 of text document “f_action_main.html” ’ string to a more general parameter set.
Can somebody please help me with this snippet a lil bit?

thanks in advance,
LaSchmoove

Model: G5
Browser: Safari 312
Operating System: Mac OS X (10.3.9)

even a link to applescript support for this would help me maybe. I’m just new to this and want to learn how to use it for text editing macros.

La Schmoove

You can use “text window 1” instead of a specific document reference. That would be the current open window.

There was recently a lengthy discussion headed Find & Replace, in the Code Exchange forum, which might interest you. You can check it out at: http://bbs.applescript.net/viewtopic.php?id=13008&p=1

While the information won’t help you with your specific BBEdit questions, I posted a message there on 2005-06-22 04:35:47 (about halfway through the discussion) that touches on switching special German characters, reading and writing text direct from/to a file - and carrying out similar conversions using TextEdit. (I’ve also just updated some of the code in that message - to take care of a Unicode text issue in Tiger that was subsequently identified by Nigel Garvey.)

As far as creating a droplet is concerned, you might like to briefly check out unstuffing files/folder at http://bbs.applescript.net/viewtopic.php?id=13324. (While the actual subject may be of little interest to you at the moment, a short droplet example is given.)

If you get confused or ‘run into sand’, don’t worry. Just come back here and shout for more help. :slight_smile:

thank you so much for your useful support. it is very appreciated.
Useful help like this is quite seldom in message boards.

I try to figure out your tips now. I will come back later.

thanks again.