Jump to content











Photo
- - - - -

Shortcuts


  • Please log in to reply
6 replies to this topic

#1 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 30 March 2007 - 12:27 PM

I uploaded several scripts which bring a new mechanism into building shortcuts.
  • The scripts which wants to have a shortcut, requests it at buildModel (same syntax as before)
  • buildModel parses the syntax and writes the result into a ini file
  • then buildModel calls the activated shell script [add-shortcut] which builds the shell's specific shortcuts.
I changed Explorer script to build shortcuts optionally in the old buildModel way, or using Ove's (modified) shc.au3 script, which builds the shortcuts at boot time.

Additionally I added a modified Xobelite script (from version 042 or similar) which adds some menu entries.
The code:
[Add-Shortcut]

  AddVariables,"%buildModelScript%","Variables"

  IniRead,#1,"Shortcut","shortCutType",%shortCutType%

  If,%shortCutType%,Equal,SM,Run,%ActiveShell%,Build-Shortcut,#1

  

  [Build-Shortcut]

  If,NotExistFile,%XobDir%\menu.rc,Run,%ActiveShell%,run-first,#1

  IniRead,#1,"Shortcut","shortCutName",%shortCutName%

  IniRead,#1,"Shortcut","shortCutExe",%shortCutExe%

  IniRead,#1,"Shortcut","shortCutParameters",%shortCutParameters%

  TXTAddLine,%XobDir%\menu.rc,"[exec] (%shortCutName%) {#$q%shortCutExe%#$q %shortCutParameters%}","Place","16"

  

  [run-first]

  ExtractFile,%ActiveShell%,"menu","menu.rc",%XobDir%

  TXTAddLine,%XobDir%\menu.rc,"[end]","Place","15"

  TXTAddLine,%XobDir%\menu.rc,"[submenu] (nativeEx SM)","Place","15"

  

  [process]

  // psc new shortcut mechanism

  IniWrite,"%ProjectDir%\script.project","Variables","#$pActiveShell#$p","%ScriptFile%"

  

  ...
xob.gif
Only the 'services' program runs well, taskmanager, notepad and regedit let Xobelite reboot. But that is a question of the Xobelite script, not of the shortcut mechanism.

BTW: buildModel parser accepts also Ove's syntax, with a small modification:
Commas, quotes, spaces etc must be replaced by the WinBuilder/Delphi escapes.
Sample of such a line:

Run,%BuildModelScript%,Add-Shortcut,"1","!WD\explorer.exe#$c!DE\RAMDrive#$c#$c/e!c%RAMDRV%
#$cGo#$sto#$sRAMDISK#$c!WD\system32\shell32.dll#$c#$c12"


IMPORTANT: For Xobelite and Ove's method you need WinBuilder version 068 beta 14a.
You can get it in the download area at WinBuilder > nativeEx_barebone
.

Peter

#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 30 March 2007 - 02:37 PM

Excellent method - but there is one issue that haunts every script each it is run just once instead of building from scratch:

The Add line method will keep on adding repeated menu entries on xoblite's menu.rc file - Wouldn't it be preferable to write an INI key on a third place to avoid these single script entries from being looped?

BuildModel would read the file where shortcuts are listed to be created and then overwrite menu.rc with the correct menu items.

This was just a flashback from my issues when using xoblite - maybe it is simply too hard to accomplish this task.. :cheers:


Have a good weekend Peter! :cheers:

#3 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 April 2007 - 03:33 PM

Excellent method - but there is one issue that haunts every script each it is run just once instead of building from scratch:

The Add line method will keep on adding repeated menu entries on xoblite's menu.rc file - Wouldn't it be preferable to write an INI key on a third place to avoid these single script entries from being looped?

BuildModel would read the file where shortcuts are listed to be created and then overwrite menu.rc with the correct menu items.

This was just a flashback from my issues when using xoblite - maybe it is simply too hard to accomplish this task.. :cheers:


Have a good weekend Peter! :cheers:


I really did not and do not want to make a well running Xobelite script.
I changed the old script just for demonstration how to work with shortcuts.

But in the weekend I walked a lot, and during walking I considered many things.

I want to make the demonstration better (not the Xobelite script itself, there is something missing, maybe WinSxS).
I want to prohibit duplicates and make different submenus for Explorer's SM, DE, QL.
Let you surprise tomorrow :cheers:

Peter

#4 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 01 April 2007 - 05:36 PM

The Add line method will keep on adding repeated menu entries on xoblite's menu.rc file

@Nuno:
I'm proud that I can explain to you: How, using your script engine, solve the 'repeat' issue :cheers: :
Instead of

TXTAddLine,%XobDir%\menu.rc,"[exec] (%shortCutName%)","Place","16"

use

Set,%MyLine%,"[exec] (%shortCutName%) {#$q%shortCutExe%#$q %shortCutParameters%}"
TXTReplace,%XobDir%\menu.rc,%MyLine%,""
TXTAddLine,%XobDir%\menu.rc,%MyLine%,"Place","16"

Inspite it works, unfortunatelly this causes unnecessary empty lines in menu.rc
Theoretically this would be correct and avoid empty lines:

TXTReplace,%XobDir%\menu.rc,%MyLine%#$x,""

But there seems to be an script engine issue which converts
#$x to a space rather than to a line break. :cheers:
Maybe it is also an issue of understanding <CRLF> or <CR> only or <LF> only.

I'm going to upload the new Xoblite script version 003

BTW: for the multi-submenu version give me 5 (Brazilian) minutes.

Peter


#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 02 April 2007 - 09:17 AM

I published version 004 of Xobelite.script, which optionally provides one menu or separate menus for DE, SM, ...
xob_menus.gif
Please let me repeat:
This script is for demonstration only, how to work with shortcuts.
It is not intended to provide a well running Xobelite shell.
Some programs of the menu start normally, some programs crash or reboot Xobelite when starting.

Peter

#6 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 02 April 2007 - 11:29 AM

There was a nice bug in version 004: I forgot to delete the menu of the previous build.
Therefore when removing an app, the shortcut stilll remained.

Fixed > version 005

Peter

#7 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 02 April 2007 - 08:44 PM

Sounds a really good fix - will test once I get some free time.. :cheers:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users