ActiveState Community

Macro Execution (playback) Error

Posted by Stanley_Tweedle on 2008-02-03 09:26

Hi there. (mods, please note the possibility that this should be in 'Macros' vs. 'Open Komodo'. thanks!)

I'm merely writing here to report an error i received when attempting to play my first macro. It's not shocking that it didn't function as i expected, considering that the macro recorded a Search / Replace replace function.

PREFACE:
Having just created a new document (from My Templates) in

Komodo Edit, version 4.2.1, build 283000, platform win32-x86.
Built on Tue Nov 13 14:27:17 2007.

I saved the doc, then executed the Preview command, Configured Browser to preview from within the Komodo Edit UI (Open Komodo). Consistent with the default action, a Komodo Edit dialogue prompts me to configure the URL i'd like to use for previewing the active file. Taking the lazy, time-saver route, i chose to use that string which Komodo places into the dialogue by default.

Hopefully, the impressively thorough Open Komodo development contributors will include a fix for the string which appears under Option: 'Preview with another File or URL', so that the solidus character is consistent with the req of http protocol-- but currently (on the Windows platform) the Path is inserted into that text field in Windows filesystem format-- that is, with a Reverse Solidus (this, my expert assessment from 2-days experience i have with the extraordinary IDE). One might infer (and one would be correct, in this instance) tha the Reverse Solidus is encoded, from ASCII to Hex, as '%5c', thus creating an invalid URL, and no preview.

SPECIFICS OF THIS ERROR:
I attempted to 'workaround' this minor issue by creating a macro (as i've done in other applications), where I would copy-to-clipboard the FULL PATH of the active file, paste it-- commented-- into the file itself, select only that full path string then hit Record, open a Replace dialouge, configure the replace function to search for the character \ in the string, and replace it with / , thereby transforming the default Komodo-placed URL string from the Preview dialogue, into one which will accurately point to the URI (i.e. my new file) -- that is, the default string transformed into an HTTP formatted URL by merely changing each instance of a single character, the Reverse Solidus. (BLAH! sorry-- i wish i were concise too!)

anyway-- so the macro didn't work (when i tested it, same file, pasing same string, etc.).

i've experienced the same macro functioning okay in other Editor components, so i trust it's a viable method. the following is the error feedback upon the macro failing...

Syntax error in macro:

exception[message] = unterminated string literal
exception[fileName] = chrome://komodo/content/project/peMacro.js
exception[lineNumber] = 445
exception[stack] = ()@:0
macro_evalAsJavascript()@:0
eval("function() { \n// Macro recorded on Sun Feb 03 2008 10:22:43 GMT-0500 (Eastern Standard Time)\nkomodo.assertMacroVersion(2);\nif (komodo.view) { komodo.view.setFocus() };\nFind_ReplaceAllInMacro(window, 1, '\\', '/', false, 0, 0, false, false);\n\n }; ")@:0
macro_evalAsJavascript("// Macro recorded on Sun Feb 03 2008 10:22:43 GMT-0500 (Eastern Standard Time)\nkomodo.assertMacroVersion(2);\nif (komodo.view) { komodo.view.setFocus() };\nFind_ReplaceAllInMacro(window, 1, '\\', '/', false, 0, 0, false, false);\n")@chrome://komodo/content/project/peMacro.js:441
([object Array])@chrome://komodo/content/library/macros.js:158
()@chrome://komodo/content/library/macros.js:171
()@chrome://komodo/content/editor.js:184
("cmd_executeLastMacro")@chrome://xtk/content/controller.js:61
doCommand("cmd_executeLastMacro")@:0
command_doCommand("cmd_executeLastMacro")@chrome://komodo/content/library/commands.js:244
@chrome://komodo/content/library/commands.js:205

exception[name] = SyntaxError

thanks. sorry for the extra-long text here, but it made sense to give the BG when i started the topic!
;-)

oh, BTW-- holy cow! Komodo Edit / Open Komodo is... i dunno-- i'm at a loss for words for 'totally the best /free/ integrated development envioronment i've ever tried!!!'. THIS truly must be the future of the web dev editor! how exciting to be on-board this early in the game.

:-)

jeffg | Sun, 2008-02-03 20:16

Can you post back with the source of this Macro? Right-click on the Macro in your toolbox and select either 'Properties' or 'Edit' to view the source created by the Macro recording.

--
JeffG

Stanley_Tweedle | Mon, 2008-02-11 14:50

Hi, JeffG. It's unfortunate that-- having just now viewed your helpful reply, the erroneous macro is long gone.

if i think of it, i'll try it again and-- if the same error results-- i'll post the code at that time.

best regards.

-js

--
Novice Developer?
Check out NoviceNotes.Net