@trixie
Quote:
Quote:
@broadblues
Quote:
broadblues wrote:
Sending script commands to ARexx (via arexx.class at least) requires an absolute path to the script.
None of the script locations or any paths are hard coding into SketchBlock they are all setup via the xml prefs file.
But putting <command>SketchBlock:Rexx/SaveAsBrush.rexx</command> in your XML prefs file - as you do - means exactly that: hardcoding it! Instead, you should:
Well I supose that depnds on your definition of "hard coded"
The preferences are entirely user editable, so may be changed to anything the user desires. I'm not sure why you find the sketchblock: assign so problematic, it's not exactly an unheard of concept for apliacation to have a assign to some data directory ot other.
Looking at my assign list I see:
AMISSL AmigaOS4:Devs/AmiSSL
ANTIWORD AmigaOS4:Utilities/antiword
Apache Work:NetApps/Apache-1.3.33
APOD Work:aPod
ARTEFFECT Work:ArtEffect4-Demo
AWebPath Work:NetApps/AWebPPC
AWEB_APL Work:NetApps/AWebPPC
C4D Work:Cinema4D
C4DCD <CINEMA4D_CD-Edition:Bonus>
CVSHOME AmigaOS4:Home
FreeDB Music:FreeDB
FTPMountDir AmigaOS4:FTPMountDir
GCC Programing:SDK/gcc
GHOSTSCRIPT AmigaOS4:Utilities/Ghostscript
imagefx4 Work:ImageFX4
MUI AmigaOS4:MUI
PGP Work:PGP5
PPaint Work:ppaint
PYTHON AmigaOS4:System/Python
TEX Work:Cinema4D/Textures
TurboPrint AmigaOS4:TurboPrint
YAM Work:NetApps/YAM
Some added by me some by the installation processes of those apps, some that come with the system.
Quote:
1. Store only the script name in the prefs file, eg. <command>SaveAsBrush.rexx</command>
2. Call IDOS->GetVar("ENV:AppDir/SketchBlock", ... ) to obtain the absolute path to the SketchBlock directory.
3. Construct the full path of the script by appending "Rexx/" and the script name (from the XML file) to the program path obtained in Step 2.
4. Call the script via ARexx.
I could do some variation on that, I'm not sure using appdir: is reliable for thsi purpose, some users write protect their sys: partitions rendering it inopperable. And I certainly wouldn't hardcode in the Rexx drawer
Quote:
I can't see why this wouldn't work.
Well it would in so far as it would launch scripts, but it's not so simple as that. As well as scripts you'll see there are 'commands' in the xml file, these are direct calls to the sketchblock arexx interface.
Given that a script need not have an extention there is no way for me to distinguish commands from scripts (save search my commands list before invoking, but that's allready done bt the ARexx.class, it would be silly to do it twice.
Oh and another thing, ARexx searches for scripts without absolute path name in REXX: