Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
109 user(s) are online (71 user(s) are browsing Forums)

Members: 1
Guests: 108

Paul, more...

Headlines

 
  Register To Post  

Application Suggestion for willing Developer
Quite a regular
Quite a regular


See User information
Hi,

I'd like a simple, basic command line program or other solution that anyone can use to determine whether application named A is already installed in the main dock (or anywhere) of AmiDock.

Process:

1. Your program reads in the XML file associated with the current AmiDock.
2. Searches for the name given in the command line arguments.

If an instance is found either or both a warn is raised or a local environment variable is set containing the filename and path of the instance that we can perform a conditional check on.

I could properly do this myself in Hollywood in one afternoon, but surely SURELY someone can find time to write something in C/C++ or PortableE that can pull this off without me resorting to bloatware.

I might suggest something on OpenAmiga if feedback is poor here.

Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
Quote:
2. Searches for the name given in the command line arguments.

I don't understand this part.

What I understood is that you want to run a "FindInAmidock" tool. This can be achieved very easily with a script. Something like:

.key COMMAND/A
.bra [
.
ket ]
search >NILenv:sys/amidock.amiga.com.xml [command]
if 
warn
   
echo Not found
else
   echo [
commandis installed in Amidock.
endif


Edited by Elwood on 2011/8/2 19:40:13
Edited by Elwood on 2011/8/2 19:41:01
Philippe 'Elwood' FERRUCCI
Sam460ex 1.10 Ghz
http://elwoodb.free.fr
Go to top
Re: Application Suggestion for willing Developer
Quite a regular
Quite a regular


See User information
Seems you know what you are talking about Elwood, I'll give it a whirl.

If that works which I suspect it will that script should be included as standard in C:!

Go to top
Re: Application Suggestion for willing Developer
Quite a regular
Quite a regular


See User information
You are a genius!


Edited by djrikki on 2011/8/2 21:27:12
Edited by djrikki on 2011/8/2 21:34:30
Go to top
Re: Application Suggestion for willing Developer
Just popping in
Just popping in


See User information
If you want to find the command from anywhere, not just in
the amidock then you can try the script below.
Open notepad and paste in what's between ==== lines.

;===================================
.KEY FILE/A
.BRA {
.KET }

if exists ${appdir/{FILE}}
echo ${appdir/{FILE}}
else
echo "*"{FILE}*" Not found in cache."
endif
;===================================

Now save it as "S:??" (thats S: plus two question marks)
and also set the +s script bit with; "protect S:?? +s"
(or choose your own name)

Now an example, if you have IBrowse installed, then
from a shell, just type; "?? ibrowse"
It will tell you where it is, (or not).



Go to top
Re: Application Suggestion for willing Developer
Supreme Council
Supreme Council


See User information
Arexx scripts go, naturally, in S:Arexx

Anywhere else might be found , but this is where system scipts go. Oh hang on, this isn't a system script, my bad! :)

Simn

Comments made in any post are personal opinion, and are in no-way representative of any commercial entity unless specifically stated as such.
----
http://codebench.co.uk
Go to top
Re: Application Suggestion for willing Developer
Just popping in
Just popping in


See User information
Actually you're kinda right Simon, I have an added path
to S: on my setup, but the default install places shell
scripts in the S:Shell directory and there is also a
path there by default.
So "S:Shell" is the best place for it.

Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
Quote:
Elwood wrote:
What I understood is that you want to run a "FindInAmidock" tool. This can be achieved very easily with a script. Something like:

.key COMMAND/A
.bra [
.
ket ]
search >NILenv:sys/amidock.amiga.com.xml [command]
if 
warn
   
echo Not found
else
   echo [
commandis installed in Amidock.
endif

Just be aware that this method is not foolproof. As an example, try looking for a program named "acemen".

To be absolutely robust, one should probably parse the XML file and find the correct elements in the relevant context. But it might be useful to have an easier API to things like this. Shouldn't application.library be able to provide this, e.g. to use from ARexx or Python?

Best regards,

Niels

Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
@colinw

Or GetEnv appdir/ibrowse

(alternatively if your app is in the system path: Which command)

But I think that wasn't what was asked in the first post.

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
@djrikki
Quote:
You are a genius!

Not at all, but I'm trying my best

Philippe 'Elwood' FERRUCCI
Sam460ex 1.10 Ghz
http://elwoodb.free.fr
Go to top
Re: Application Suggestion for willing Developer
Just popping in
Just popping in


See User information
Why not create a drawer specific for scripts in eg C:Scripts and keep all dos/python/Arexx/Lua scripts in there ?

Hmm maybe even all C: programs can use script equivelents especially DIR/List etc, so they can be easily updated.

I like this x86 command line program that has multiple features - Swiss File Knife :

http://stahlworks.com/dev/swiss-file-knife.html


Go to top
Re: Application Suggestion for willing Developer
Just popping in
Just popping in


See User information
@angelheart

Because there's already a drawer for this purpose, it's called S: (for Scripts). C: is for Commands. Why reinvent the wheel ?

Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
Quote:
angelheart wrote:
I like this x86 command line program that has multiple features - Swiss File Knife :

http://stahlworks.com/dev/swiss-file-knife.html

Yes, those kinds of "do-it-all-in-one-program"/"Jack-of-all-trades" solutions seem to be popular on those platforms. I've never understood why.

In AmigaOS we usually have separate commands or programs for each of those tasks. So instead of having to type e.g. "sfk list", "sfk delete" or "sfk find", we only have to type "list", "delete" or "search" (with appropriate arguments in both cases).

Of course some of sfk's subcommands can do things the corresponding Amiga commands can't - and vice versa. But if we need any of those features, we can usually create them with a simple script which again can be called (after being "S"-protected) with one word.

Just my humble opinion.

Best regards,

Niels

Go to top
Re: Application Suggestion for willing Developer
Just can't stay away
Just can't stay away


See User information
Quote:

centaurz wrote:
@angelheart

Because there's already a drawer for this purpose, it's called S: (for Scripts). C: is for Commands. Why reinvent the wheel ?

And nowadays we even have the subdirectories S:Shell (for shell scripts) and S:ARexx (for ... you guessed it ).

Best regards,

Niels

Go to top

  Register To Post

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project