English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 13 November 2016, 18:59   #41
Pheonix
Registered User
 
Join Date: Aug 2009
Location: Waco USA
Posts: 253
One of the reasons I set it up to go through the .info files in the first place was because it is possible to have an operative Icon that doesn't have a matching non-Icon file. I've set it up myself, with an Icon that passed it's name (minus the .info,) as a command line option instead of as a file to load. the program that started this isn't like that, but when I started expanding into actually building a WBStartup drawer, that was one of the first things I thought of.

It would have actually been easier to just plug in the name of every non-info, non-directory file in the directory. The program I'm using adds the .info itself, and errors out if I include it. So, I have to strip the .info off the end of the name. But if there are any Icons that don't have a corresponding non-icon file, they would get skipped. Also, if any files without icons ended up in the directory, the script would then error out. This way keeps Icons from being skipped & also insures that the script doesn't try to run an icon that doesn't exist.

Since I'm closing the file almost immediately after opening it, I don't see how that much overhead can build up. The file is opened, one byte is read, then the file is closed. The only other command is a seek to the correct byte location. Open, Seek, Read, Close. Unless there is a bug in one of those routines, there shouldn't be any sort of issue.
Pheonix is offline  
Old 14 November 2016, 13:13   #42
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,094
How does such an icon look, one that passes its name as a command-line option?

If that's a use case, doing a scan for directories and filtering out their matching icons from the file list could also be a way to save on time and disk access.
idrougge is offline  
Old 14 November 2016, 18:25   #43
Pheonix
Registered User
 
Join Date: Aug 2009
Location: Waco USA
Posts: 253
I've been trying to remember what I did exactly (Icon passing its name as CL option.) All I remember is I had a folder with several Icons and no files attached. Each Icon was named for a profile I wanted to enable. Switching modes was just a matter of double clicking on the appropriate icon. The folder had 1 file and 7 or 8 icons. All the icons were project icons that called that file, and the name of the icon told it how to change things.

Thinking back on it now, it could very well have been on the OS 2.1 side of my system. I haven't been able to set anything like that up for testing on my current OS 1.3 re-build. I don't remember the utility I had set that up on, I just remember setting it up by following the instructions provided with the utility.

Yes, it would reduce disk access and that can impact running time, especially if run on a floppy. However, I also have a habit of trying to imagine everything that can go wrong. Such as someone copying a Disk.info file into the directory their working with, or using CLI to delete the directory without also deleting the Icon. So, the latest version now limits itself to tool & project icons only. My next version may include a method for specifying the types of icons to work on (or exclude.)
Pheonix is offline  
Old 15 November 2016, 11:14   #44
Pheonix
Registered User
 
Join Date: Aug 2009
Location: Waco USA
Posts: 253
Latest versions. Added in icon type specifications. So now you can designate the directory(ies) to be scanned (requires at least one.) Specify the command to use (also required.) Specify how deep to scan sub-directories (not required, defaults to none.) Specify the icon types to work on (not required, defaults to tools.) Finally, specify if the '.info' is to be removed from the file name when it is passed to the chosen 'command.'

I have also rolled it back to just scanning a single directory (SYS:WBStartup,) with no sub-directories, tool & project icons only, and fixed command (WBLoad.) Mainly because all the additions I've been adding has slowed it down. But this has turned into a learning project for me I've included both scripts below (IconRun.txt & WBStartup.txt,) which should, of course, both be renamed to .rexx files before use.

I'm also including an alternate method of checking the .info files that does not involve opening the file. This has reduced command line options, as they will no longer be applicable (if I'm not opening the icon, all I can really do is check if a "file" exists for it or not.) Since it is a refrain from any extra disk reads, it works off the available file list instead of using the Exists option.

Don't know if they can be streamlined any farther or not. I can't think of anything. Can't seem to find any more bugs myself, either. IconRun is the full script, WBStartup is the simplified version. The ones marked as '2' are the alternate check methods (looks for a corresponding attached file, instead of reading the .info file.) Haven't done any speed testing yet. That may vary depending on the HW in question.

:EDIT: Re-Uploaded the files with PC linefeed formatting added. Yes, some might be using a browser that supports the Amiga format, but I believe that most need the "\r\n" formatting that the PC uses.
Attached Files
File Type: txt IconRun.txt (4.7 KB, 107 views)
File Type: txt WBStartup.txt (753 Bytes, 104 views)
File Type: txt IconRun2.txt (3.9 KB, 99 views)
File Type: txt WBStartup2.txt (940 Bytes, 96 views)

Last edited by Pheonix; 15 November 2016 at 11:18. Reason: Forgot to add PC formating to the txt files :(
Pheonix is offline  
Old 15 November 2016, 12:53   #45
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,094
All browsers use the Amiga format.
idrougge is offline  
Old 15 November 2016, 14:46   #46
Pheonix
Registered User
 
Join Date: Aug 2009
Location: Waco USA
Posts: 253
Quote:
Originally Posted by idrougge View Post
All browsers use the Amiga format.
Mine doesn't appear to. When I opened the text file right after uploading it, the first time, it tried to put it all on one line. Added in the /n (or was it /r, just put it through a filter,) and it displayed properly after the re-upload.

I don't have a browser on my Amiga. So I don't know how it would have worked on one. Move the filtered file to my Amiga without filtering it back and it just ends up double-spacing it. So, I figure it's pretty safe to just filter it prior to the upload (when I remember.) Saves anyone else who want to read it from having to download it then filter it first. If your browser works with the Amiga format, then you should be getting my text files double spaced.
Pheonix is offline  
Old 28 January 2022, 05:12   #47
Gernot66
Registered User

Gernot66's Avatar
 
Join Date: Jan 2022
Location: Switzerland
Age: 55
Posts: 2
Is your problem solved? (i haven't the patience to read all)

I have a couple of programs which need to be run after "LoadWB" it comes close to the later "WBstart" directory, you need as suggested often RunWB or similar especially if the program requires tooltypes to be defined, else a runback will do it - in my case for a titlebar clock which else would run fine but the Worbench itself don't likes if it's started before LoadWB, a clicktofront for 1.3 which is a little quirky and needs to be runback and after LoadWB, and last but not least i end the boot with splattering a picture on the screen, respectively replacing the one during boot and quitting all that with a SFX and a useless info about the lucky no. drawn, the new cli has mostly the function to keep the process running until end, it is an idea to run the whole "post-loadwb" script in a new cli either with newcli or cliexe which i find more useful for such (it allows a string of commands to be run in the new cli i.e. i can clear the screen already before i execute the script this swallows the "newcli..." message at start completely - very nice for an info additionally you can size the window down to 20 pixels height for a single line of text), similar i report about else quiet processes when selected in MyMenu i.e. reloading the menu which else can be swallowed but when run in a new cli it can't be swallowed and additionally it will print out if it has loaded or failed... erm yes and MyMenu i even starts after LoadWB else it often happens that it quits reporting "unusual Workbench menus found" obviously because there is simply no menu when the WB hasn't loaded yet, "IFFBeep" even likes to be run after LoadWB, there are a couple of programs (let's say commodities) which you might like to start at boot-up but work best when started after LoadWB, recently none of them needs a RunWB or similar but this can be as well.
Gernot66 is offline  
Old 28 January 2022, 05:24   #48
Gernot66
Registered User

Gernot66's Avatar
 
Join Date: Jan 2022
Location: Switzerland
Age: 55
Posts: 2
off topic
i guess the real advantage of cliexe is that you can run a script in a shell which uses by default the shell-startup (or cli-startup depending on which you invoke) script and all it's functions while executing a script in it, a newshell (or newcli) can load a script defined with FROM but then you have to probably setup the shell for the script and neither you can execute commands before or after the script (all in all yes it just copies the whole turd in a temporary to execute script and this would be to reach otherwise as well).
Gernot66 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make an Workbench Icon running a CLI Script ? Marskilla support.Other 9 26 April 2016 23:11
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 09:27
Possible to run a program from CLI in background? VoltureX support.Apps 17 14 January 2012 03:16
CLI program to resturn joy direction or fire button. olesio request.Apps 26 04 November 2011 18:18
CLI program to make mouse pointer dissapear on KS 3.X Gaula92 request.Apps 5 21 October 2011 14:49

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.07270 seconds with 15 queries