moudey / Shell

Powerful context menu manager for Windows File Explorer
https://nilesoft.org
MIT License
3.62k stars 121 forks source link

Improve import documentation #301

Closed BergenSoft closed 1 year ago

BergenSoft commented 1 year ago

I tried already a few hours but the imports make me big troubles. Even the current documentation is not helping. The documentation shows only how the import statements should look like, but there are no examples how the imported files should look like.

Could you please explain what I'm doing wrong here? I'm using v.1.8.1.

// shell.nss
shell
{
    // .. var and set sections

    import 'imports/extension.nss' // Error pointing to the beginning of this line
}
// extension.nss
shell
{
    static
    {
        // some static entries
    }

    dynamic
    {
        // some dynamic entries
    }
}

I tried also several other combinations, but nothing seems to work. In this example I got the error: Identifier config unexpected "shell.nss"

moudey commented 1 year ago

Version 1.8.1

shell
{
    images import 'imports/images.nss'

    static
    {   
        import 'imports/static.nss'
        item(where=this.title.length > 25 menu=title.more_options)
    }

    dynamic
    {
        ...
        import 'imports/new.nss'
        ...
    }
}
//static.nss
shell
{
    item(type='recyclebin' where=window.is_desktop and this.id==id.empty_recycle_bin pos=1 sep)
    item(type='back' find=['shortcut', '/new'] vis=vis.remove)
}
//new.nss
item(title="config" image=\uE10A cmd='"@app.cfg"')
item(title="manager" image=\uE0F3 admin cmd='"@app.exe"')
item(title="directory" image=\uE0E8 cmd='"@app.dir"')

debug version

// shell.nss
import 'imports/extension.nss'
// extension.nss
// some static entries
modify(type='back' find='shortcut' in='/new' vis=vis.remove)
//import 'cleanup.nss'

 // some new entries
item(title='Windows' image=inherit cmd=sys.dir)
item(title='System' image=inherit cmd=sys.bin)
item(title='Program Files' image=inherit cmd=sys.prog)
menu(title="test")
{
   import 'new_items1.nss'
}
import 'new_items2.nss'
// new_items1.nss
item(title='item1')
item(title='item2')
// new_items2.nss
menu(title="test2")
{
    item(title='item3')
    item(title='item4')
}
item(title='item5')
BergenSoft commented 1 year ago

Ok, now I understand it a bit more. But with the debug part you really confuse me. I find a link to the debug build. Has the configuration syntax completely changed? I have a working configuration now which makes me really happy, but because of a bug with multiple monitors I've tried the debug build, but my complete configuration seems to be broken. Could you please give me a hint what happend here? Even the shell { at the beginning is wrong.

moudey commented 1 year ago

There are new changes in the configuration. Where the variables section, the static section, and the dynamic section were removed, as well as the shell namespace from the header of each configuration file.