English Amiga Board


Go Back   English Amiga Board > Requests > request.Apps

 
 
Thread Tools
Old 23 October 2021, 20:58   #1
Jolabandola
Registered User
 
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
Make icons that executes a cli script.

Hi all!
I hope this is the right subforum for this. I have tried to look up how to do it but maby someone can help me out when this seems like an easy thing to do.

I have an A600 with the A608Mini 8mb fast ram. To be able to use the pcmcia port i have to switch it to 4mb mode by opening up a new shell and type:
Code:
a608mcfg pcmciainv on
To switch back to 8mb mode again i have to do the same thing and type:
Code:
a608mcfg pcmciainv off
A reboot is required to switch between the modes.
My question is if there is someone who could show me how to make an icon for each of these commands. It seems like it is possible to make two icons and just doubleklick one of them and then reboot to change the mode.
Any help would be appreciated.
Jolabandola is offline  
Old 23 October 2021, 21:08   #2
Matt_H
Registered User
 
Matt_H's Avatar
 
Join Date: Jul 2008
Location: Boston, MA
Posts: 943
What you’re looking for is a shell script. Just save each command in a plain text file, give each file an icon (project type) and set the default tool to IconX.
Matt_H is offline  
Old 23 October 2021, 21:25   #3
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
You can also run a text file from an icon without other tools like IconX, you just need to add the "S" flag to the file.

After that you can assign to this script any "executable" icon.

Basically it will behave like the .bat file on Windows PCs.
AMIGASYSTEM is offline  
Old 23 October 2021, 22:01   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by AMIGASYSTEM View Post
you just need to add the "S" flag to the file.
Such flag easily gets lost if you copy the files around. I would not trust it.
thomas is offline  
Old 23 October 2021, 22:08   #5
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
Yes very true Thomas, it was just to add an extra info maybe useful for the more experienced who did not know this quick procedure.
AMIGASYSTEM is offline  
Old 23 October 2021, 22:34   #6
Jolabandola
Registered User
 
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
Thank you for your help. I will try that.
Jolabandola is offline  
Old 24 October 2021, 11:51   #7
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Maybe you want only one script that uses RequestChoice to ask 4MB, 8MB, Cancel. The script could also contain the reset command for an automatic reset. Or without asking just swap the condition (boolean).
daxb is offline  
Old 24 October 2021, 12:03   #8
Jolabandola
Registered User
 
Join Date: Oct 2019
Location: Nordmaling/Sweden
Posts: 100
Quote:
Originally Posted by daxb View Post
Maybe you want only one script that uses RequestChoice to ask 4MB, 8MB, Cancel. The script could also contain the reset command for an automatic reset. Or without asking just swap the condition (boolean).
That sounds exactly like something i would want but my skills are not enough to even know where to start. Is there a way to request something like this?
Jolabandola is offline  
Old 24 October 2021, 13:40   #9
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
For RequestChoice check out your AmigaDOS manual or online (for OS4) https://wiki.amigaos.net/wiki/AmigaO...#REQUESTCHOICE (you can use the example as a template)

Or like this (not tested but should work):
Code:
set myresult 'RequestChoice  "New Title" "This is my requester.*nSelect a gadget." "_4MB" "_8MB" "_Cancel"'
IF $myresult EQ 1
    a608mcfg pcmciainv on
ENDIF
IF $myresult EQ 2
    a608mcfg pcmciainv off
ENDIF
IF $myresult EQ 0
    echo "cancel"
    exit
ENDIF

; In case you want a reset add it here:
reset ; chose your favourite reset tool
For the boolean automatic switch you need to query the current state (4MB or 8MB) information but I don't know if this is possible.
daxb is offline  
Old 24 October 2021, 17:24   #10
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,856
Quote:
Originally Posted by thomas View Post
Such flag easily gets lost if you copy the files around. I would not trust it.
If you stay on the good side of the Amiga (meaning that you do not copy on a PC partition) use the CLONE argument while copying and it won't be lost.
malko is offline  
Old 24 October 2021, 17:45   #11
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Yes, but what is with all the other Amiga programs that can edit/save icons. Do they all care about protection bits? I know that for text files you can easily lose the s bit when the texteditor doesn't care.
daxb is offline  
Old 24 October 2021, 18:40   #12
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,856
This, I don't know.
I use ed as main text editor and never had any issue on this side so far.
malko is offline  
Old 24 October 2021, 19:01   #13
AMIGASYSTEM
Registered User
 
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Age: 70
Posts: 8,248
Also to me the Text Editors I use "don't touch" and save with the "S" flag.

Even from WinUAE if you copy a file with fag "S" to a Windows folder the "S" flag will be kept !
AMIGASYSTEM 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 can I make a .bat script runnable from the desktop? Foebane support.Apps 21 16 September 2019 19:28
Opening DOpus5 CLI from script? Retrofan support.Other 14 02 August 2018 02:57
How to make an Workbench Icon running a CLI Script ? Marskilla support.Other 9 26 April 2016 23:11
Script to find orphan folders from icons mfilos support.Other 10 10 January 2014 17:47
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 21:53.

Top

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