Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
must_be_user_error #1
Extension error if DW is not restarted between uses
DWMX 2004 on a WinXP pro SP2 box. I am not running as superuser, but I'm also
only adding this script to my personal config folder.
The extension is a very simple JS designed to automate some redundant
find/replaces when cleaning up code in documents converted to HTML from within
Quark.
When I start Dreamweaver and run the script, it works with no error. I can
even run several similar extensions in a row. But try to run the script a
second time on a new document without closing and restarting Dreamweaver, and
rather than performing those nice automated find/replaces, the script throws
this into the head of the document, then does nothing:
<head>
<title>Cleanup</title>
</head>
<body>
</body>
</html>
I'm developing this for a team of people that are not going to want to have to
restart DW every time they work on a new document.
This is probably something simple that I'm just overlooking. Code is below.
Any ideas?
_______
<html>
<head>
<title>Cleanup</title>
<script language="javascript">
var counter = 0
var dom=dw.getDocumentDOM();
var mddfind = new Array()
mddfind[0] = "?"
mddfind[1] = "?"
mddfind[2] = "?"
mddfind[3] = "?"
mddfind[4] = "?"
mddfind[5] = "?"
mddfind[6] = "?"
mddfind[7] = "?"
mddfind[8] = "?"
mddfind[9] = "?"
mddfind[10] = "?"
mddfind[11] = "?"
mddfind[12] = "?"
mddfind[13] = "?"
mddfind[14] = "?"
mddfind[15] = "?"
mddfind[16] = "?"
var mddrep = new Array()
mddrep[0] = "\'"
mddrep[1] = "\'"
mddrep[2] = "\""
mddrep[3] = "\""
mddrep[4] = "\"
mddrep[5] = "\µ"
mddrep[6] = "\±"
mddrep[7] = "\°"
mddrep[8] = "\®"
mddrep[9] = "\©"
mddrep[10] = "\™"
mddrep[11] = "\¼"
mddrep[12] = "\½"
mddrep[13] = "\¾"
mddrep[14] = "..."
mddrep[15] = "€"
mddrep[16] = "§"
//Make sure we're in code view
dom.setView("code")
while (counter < mddfind.length) {
//get a value to find
var mddfindstring = mddfind[counter].toString()
//get a value to replace
var mddrepstring = mddrep[counter].toString()
dreamweaver.setUpFindReplace({searchString: mddfindstring, replaceString:
mddrepstring, searchSource: true, ignoreWhitespace: true});
dreamweaver.replaceAll()
counter++}
dreamweaver.setUpComplexFindReplace('<dwquery><que ryparams><find><qtag
qname="font"></qtag></find><replace action="stripTag"/></dwquery>');
dreamweaver.replaceAll()
</script>
</head>
<body>
</body>
</html>
must_be_user_error Guest
-
Your computer must be restarted ....
This is the error I keep getting after I installed Shockwave "Your computer must be restarted in order to complete the installation of Shockwave... -
Coldfusion Service to be restarted after each SQLCluster failover
:confused; We have Windows 2003 Servers (Std) with IIS 6.0 . Our backend is a clustered windows 2003 Ent environment, running an SQL 2005 Database.... -
Cron Not Restarted
While we have cron listed in inittab, it occasionally dies and does not restart. I have to start it with "nohup /usr/sbin/cron &" manually as... -
Persistent connection extension not freeing connections until serveris restarted
Hi all, I have a fairly advanced question regarding writting modules that create persistent resources: I've written a module very similar to... -
Application restarted
Hello Everyone, I have a ASPNET application which does some file operation under application folder. Sometime this file operation causes the... -
Randy Edmunds #2
Re: Extension error if DW is not restarted between uses
I notice that you execute the JS inline. I think this is the problem,
because DW loads extensions only once per session and then stores them
for subsequent use. Try placing your JS in a function and then calling
it in <body onLoad="yourfunc()">.
There is a lot of code in the Configuration folder, so search through
for some examples.
Hope this helps,
Randy
must_be_user_error wrote:> DWMX 2004 on a WinXP pro SP2 box. I am not running as superuser, but I'm also
> only adding this script to my personal config folder.
>
> The extension is a very simple JS designed to automate some redundant
> find/replaces when cleaning up code in documents converted to HTML from within
> Quark.
>
> When I start Dreamweaver and run the script, it works with no error. I can
> even run several similar extensions in a row. But try to run the script a
> second time on a new document without closing and restarting Dreamweaver, and
> rather than performing those nice automated find/replaces, the script throws
> this into the head of the document, then does nothing:
>
> <head>
> <title>Cleanup</title>
> </head>
> <body>
> </body>
> </html>
>
> I'm developing this for a team of people that are not going to want to have to
> restart DW every time they work on a new document.
>
> This is probably something simple that I'm just overlooking. Code is below.
> Any ideas?
>
> _______
>
> <html>
> <head>
> <title>Cleanup</title>
> <script language="javascript">
> var counter = 0
> var dom=dw.getDocumentDOM();
>
> var mddfind = new Array()
> mddfind[0] = "?"
> mddfind[1] = "?"
> mddfind[2] = "?"
> mddfind[3] = "?"
> mddfind[4] = "?"
> mddfind[5] = "?"
> mddfind[6] = "?"
> mddfind[7] = "?"
> mddfind[8] = "?"
> mddfind[9] = "?"
> mddfind[10] = "?"
> mddfind[11] = "?"
> mddfind[12] = "?"
> mddfind[13] = "?"
> mddfind[14] = "?"
> mddfind[15] = "?"
> mddfind[16] = "?"
>
> var mddrep = new Array()
> mddrep[0] = "\'"
> mddrep[1] = "\'"
> mddrep[2] = "\""
> mddrep[3] = "\""
> mddrep[4] = "\"
> mddrep[5] = "\µ"
> mddrep[6] = "\±"
> mddrep[7] = "\°"
> mddrep[8] = "\®"
> mddrep[9] = "\©"
> mddrep[10] = "\™"
> mddrep[11] = "\¼"
> mddrep[12] = "\½"
> mddrep[13] = "\¾"
> mddrep[14] = "..."
> mddrep[15] = "€"
> mddrep[16] = "§"
>
> //Make sure we're in code view
> dom.setView("code")
>
> while (counter < mddfind.length) {
> //get a value to find
> var mddfindstring = mddfind[counter].toString()
> //get a value to replace
> var mddrepstring = mddrep[counter].toString()
>
> dreamweaver.setUpFindReplace({searchString: mddfindstring, replaceString:
> mddrepstring, searchSource: true, ignoreWhitespace: true});
> dreamweaver.replaceAll()
>
> counter++}
>
> dreamweaver.setUpComplexFindReplace('<dwquery><que ryparams><find><qtag
> qname="font"></qtag></find><replace action="stripTag"/></dwquery>');
> dreamweaver.replaceAll()
>
> </script>
> </head>
>
> <body>
> </body>
> </html>
>Randy Edmunds Guest
-
www.cozzieworld.com #3
Re: Extension error if DW is not restarted between uses
These answers are brilliant and are the best answers you are going to get
[url]http://www.cozzieworld.com/[/url] play games, look at media, have free membership with many benefits right here at cozzieworld
www.cozzieworld.com Guest



Reply With Quote

