Force change view of an Ambient window in command line
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2080 from 2003/4/10
    From: France
    Hello,

    For Easy2Install, i use "open" command to open a drawer in an Ambient window.

    I would like to change (force) view mode : list view (all files) for shell commands or icon mode (all files) to show icons (sometimes drawers containing icons don't have icon...)

    Is it possible to force view mode (by lister, by icon view mode) in command line with Arexx or LUA or maybe news options for "open" command in a future version of MorphOS?

    Thanks for your answer.
  • »06.10.23 - 16:10
    Profile Visit Website
  • ghh
  • Cocoon
    Cocoon
    ghh
    Posts: 54 from 2017/7/16
    From: Prague
    Look at sys:MorphOS/Ambient/arexx/showam.rexx
  • »06.10.23 - 16:38
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2080 from 2003/4/10
    From: France
    Quote:

    ghh a écrit :
    Look at sys:MorphOS/Ambient/arexx/showam.rexx


    Cool! i think it could help me ;-)

    Thanks a lot!

    I will try to understand the script now :-D

    [EDIT] Work perfectly ;-)

    Maybe i could adapt this AREXX script to Hollywood or LUA langage with arguments to have only one script?
  • »06.10.23 - 17:04
    Profile Visit Website
  • jPV
  • Yokemate of Keyboards
    Yokemate of Keyboards
    jPV
    Posts: 2042 from 2003/2/24
    From: po-RNO
    I'm in a hurry now, but made quickly couple examples how you could convert the script into Hollywood. Not sure if I got everything right, but I'll check after couple days ;)

    Code:
    ; This function uses Hollywood's ARexx support functions, but requires 68k rexxsyslib.library installed
    Function p_OpenAmbientARexx(location$, view$, mode$, left, top, width, height)
    Local params$ = "?view=" .. view$ .. "&mode=" .. mode$ .. "&top=" .. top .. "&left=" .. left .. "&width=" .. width .. "&height=" .. height
    Local rexx$ = "ADDRESS AMBIENT;'LoadURI \"file://" .. location$ .. params$ .. "\" newwin'"
    RunRexxScript(rexx$, True)
    EndFunction


    ; This function uses the RXCmd shell command and works out of the box on MorphOS, but doesn't work on other operating systems
    Function p_OpenAmbientShell(location$, view$, mode$, left, top, width, height)
    Local params$ = "?view=" .. view$ .. "&mode=" .. mode$ .. "&top=" .. top .. "&left=" .. left .. "&width=" .. width .. "&height=" .. height
    Local args$ = "AMBIENT \"LoadURI *\"file://" .. location$ .. params$ .. "*\" newwin\""
    Execute("MOSSYS:C/RXCmd", args$)
    EndFunction


    ; Example 1
    p_OpenAmbientARexx("Ram Disk:", "list", "thumbs", 50, 50, 440, 320)

    ; Example 2
    p_OpenAmbientShell("Ram Disk:", "list", "thumbs", 600, 50, 440, 320)

  • »07.10.23 - 06:26
    Profile Visit Website