Command: ScriptWizard (multipurpose scripting resources aid)

This code in v0.4.4 ..

	var deprecatedScriptPath = "Command.Generic_ScriptHelper.js";
	deprecatedScriptPath = DOpus.FSUtil.Resolve("/dopusdata\\script addins")+
			"\\"+deprecatedScriptPath;
	DOpus.NewCommand.RunCommand('DELETE QUIET FORCE "'+deprecatedScriptPath+'"');
	DOpus.NewCommand.RunCommand('DELETE QUIET FORCE "'+deprecatedScriptPath+'.txt"');

..is still causing problems in XP. Can I suggest you add a test, along the lines of:

If (DOpus.FSUtil.Exists(deprecatedScriptPath) == true) Then {perform the deletions}

Regards, AB

:slight_smile:

You can see I'm a VBScripter rather than a JScripter. The amended code (tested) would be...

	if (DOpus.FSUtil.Exists(deprecatedScriptPath)) {
		DOpus.NewCommand.RunCommand('DELETE QUIET FORCE "'+deprecatedScriptPath+'"');
		DOpus.NewCommand.RunCommand('DELETE QUIET FORCE "'+deprecatedScriptPath+'.txt"');
	}

Regards, AB

I aussie! o) Yes you're right, but the former two uploads were just hotfixes to the forum-change, they did not contain any other fixes yet.
Currently there is some translation work going on together with Kundal. After that is done, a fixed and enhanced upload will hit this place. o)

Hi @tbone

I picked up a glitch in ScriptWizard when it is invoked in a language environment that is not in the list of languages known to the Translator function in your code.


Your list of supported languages appears to be English, German, French, Italian, and Spanish whereas the OS language in my test environment is Dutch. I haven't looked closely at the code to see if there is a simple way of dealing with this situation.

Regards, AB

Thanks for telling me, reproduced! o) Quick fix: Add "du" to "this.translations", as it has been done for "en", "de" etc..
The upcoming version version will use a generic approach and not a predefined list of languages.

Special thanks again to you Leo! o)
SW versions prior to 0.4.4 are able to update as usual again, as the "meta-tag not closed" issue in the forum software has been resolved.

Hi tbone.

Have not previously checked this out. Its good stuff mate. Thanks :slight_smile:.

I have some updated scripts to upload, and would like to consider adding support for you updating process. Could you please detail what changes should be made to scripts to add support for your script helper?
I see we should include the url to the forum in our script. Also what changes should be made to the posts?

I like to include the version number in my osp/js file name. Is that a problem?

Some comments.
It seems to ignore/strip letters from the version numbers is that expected?
Might it be better for scripts to only include the post ID, and not the full url? Or perhaps your script to prevent calls to different domains.

Aside,
I notice that the an error is thrown when you click the about button in the script section of the Preferences window.

Command.Generic: ScriptWizard: Error at line 156, position 3 Command.Generic: ScriptWizard: Object not a collection (0x800a01c3)

Hi wow, thanks. o)

Just select your script in "/script addins" and run the command "ScriptWizard PREPAREUPLOAD INTERACTIVE" (or just use the menu-button provided). It "wizards" and explains you through all the necessary changes. Make sure your script is UTF16 (LE) encoded right from the start, as WSH has issues converting from/reading other encodings.

In a post, the most important thing is, to not put the version number into the uploaded filename, use the file-comment textbox instead. I'd suggest something like "v0.2 / 2015.04.02 - speed improvements, bug fix" (version / date - notes).

A version number or anything else within a filename makes it difficult to identify a matching resource for downloading by SW, there is a tolerance builtin, but you're calling for trouble with a version-string in the name, especially since SW does not change/update a local script/filename when updating (to preserve a custom sort order by filename in DOs prefs-list of scripts).

Non-numeric chars in version strings are not supported to be compliant to DOs versioning scheme.
The full URL is required, as there is the german forum as well and another one I currently use for testing purposes.

Your error is known/fixed in the next upload, which unfortunately is overdue because I keep on tweaking some bits.
Need to stop that and upload eventually. Cya! o)

Usually i have a couple of versions in there, as well as another folder where i keep old copies of scripts and packages.
I put version numbers in the files names to make it easier to manage them.
For writing scripts, how do you manage having multiple versions?

Mhh, do I keep/manage older versions, aehm no! o) I sometimes keep a seperate version as long as I improve a specific one. While doing so, I tend to rename the "stable" version to *.dis, to prevent DO from running it. If the script to be enhanced is done, I delete the *.dis version. For anyone updating a script by SW, an archived version (with version number appended) will be stored in "/script addins/archive" - in case you didn't know, so nothing get's lost. To check what versions are active and running, I use the "ScriptDetails" columns, they work in any directory and maybe they are of use for you too: Columns: ScriptDetails (update status of add-ins etc)

So, I think you can still call your old scripts the way you like, it's just the uploaded/updated version that needs to apply to the same name. Just like it is for "DOpusInstall.exe", new version - same name. It think it also helps to prevent duplicates in "/script addins", if people download scripts from here and put them to work.

Ok, cool. I have updated some scripts to include SW support. Thanks again for putting it together.

I added an icon for the main menu. Thought you might like it.
I attached the package with the icon and the latest script.

Thanks wow! o)
I added two more icons and created an icon set out of your upload.
The set and credits to you have been added to the thread opening.
You know what to do with that osp now? o)

nice mate. Whats the benefit of using the icon package over putting the icons in the script package? I have been putting them in the script package as it makes for a single download. Does make editing the script a couple of extra steps.

I just like to stay with single script uploads for now, as I don't want to re-pack each time and lose SWs upload-assistence (which can't handle *.osp). I think the extras are still easy to get and the icon-package is possibly also interesting for non-SW users.

What exactly do you mean with "editing the script"?
Cya! o)

hit tbone, there is an error in the script. Specifically in relation to this page Column: EML/MSG (email files) columns .

I'm guessing, but are you parsing the webiste as xml? This will often cause issues as HTML is not XML compliant, XHML is.

Yeah, parsing the html as xml, but by prepping and filtering the content before. The current SW version available here (v0.4.x) does not yet feature all the precautions and tricks implemented in the meantime. v0.5.4 is what I use here currently and I don't have any issues, lucky me! o)

If you like to try this v0.5.4 preview and report back I'd be happy:
Command.Generic_ScriptWizard.js.txt (333 KB)
I guess you can also fix the issue by not using lists in the thread post. These are really screwing up the markup.
Thanks for posting, any error report is greatly appreciated!

Quick report. ScriptWizard has been throwing errors on every other script ("error" in the status column and error reports in the log). I downloaded and installed v0.5.4 / 2015.07.12 from your post above, and the errors are gone in the column and in the log. That looks like success.

Thank you Julian for testdriving the preview! o) I think it's time to turn that into something substantial.
SW will still be able to update itself once that new version is available, things should be back to normal for all the other scripts then as well.
I've been delaying the upcoming changes much too long, sorry for any inconveniences.

Updated to v0.5.5:
What's new:

  • multi-language support (en, de available for now, further translatiosn are easy to add)
  • german translation by kundal
  • major ScriptDetail columns fixes and enhancements (especially the builtin cache, try it! o)
  • FILE option defaults to folder "script addins" now (no need to pass full path anymore)
  • column "enabled" separated, not included in cache anmymore
  • updating script to package or reverse does not change basename
  • new script config items to disable preservation of basenames
  • new script config item to disable log output for columns
  • self auto-update options (check and change script config if you don't like that)
  • version string comparison enhanced
  • log file size limited to 2-3mb
  • ConfigHelper updated to v1.2

What's fixed:

  • remove wrong utf8/16 bom, when saving out to utf16 (upload preperation)
  • fix for basename-preserve not removing *.txt extension
  • error fix for unknown language in translator
  • ul/li tags filtered to prevent thread-parsing error
  • winXP error-dialog fix on initialization
  • about-dialog error fix for multiple or no listers present
  • fetching enabled-status and dopus id of script packages fixed
  • about dialog confirmation texts equalized
  • error handling enhancements

Many thanks to kundal for maintaining the german translations! o)
Many thanks to all of you who reported errors and malfunctions, I hope to have nailed them all!