Topic: Shorcut Behaviour and syntax...again  (Read 1957 times)

0 Members and 1 Guest are viewing this topic.

Shorcut Behaviour and syntax...again
« on: May 17, 2011, 10:40:42 PM »

niche99

  • Diner
  • Jr. Chef
  • *
  • Date Registered: Apr 2011
  • Posts: 36
Hi,

Testing this code and behaviour is inconsistent.

Code: [Select]
If,%CheckBoxSubFolder%,Equal,True,Set,"%SubFolderName%","%TextBoxFolderName%"
If,%CheckBoxSubFolder%,Equal,False,Set,"%SubFolderName%","."
If,%CheckBoxShortcutDesktop%,Equal,True,Add_Shortcut,Desktop,"%SubFolderName%"
If,%CheckBoxShortcutStart%,Equal,True,Add_Shortcut,StartMenu,"%SubFolderName%"
If,%CheckBoxShortcutStartup%,Equal,True,Add_Shortcut,StartMenu,"Startup\%SubFolderName%"

Assuming TextBoxFolderName = "Back Up" and CheckBoxSubFolder is True.
Can anyone tell me why this works as expected for the above cases EXCEPT Desktop where no sub-folder is created.
Granted Startup doesn't seem to behave as expected when the shortcut is executed opening an explorer window instead of executing the shortcut contained in the sub-folder, which BTW does execute correctly if clicked/executed manually.

Regards,
niche99

Re: Shorcut Behaviour and syntax...again
« Reply #1 on: May 18, 2011, 12:06:31 AM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1957
Hi niche99,

WB wand full syntax provides this:

Code: [Select]
//Add_Shortcut,Type,StartMenuFolder,(path\)FileName,Title,Work Folder,Parameters,(path\)IconFile#$cIconIndex,StartMode=(1,2,3),ToolTipText(only Gena/LiveXP)

Hence second parameter is used for the Start Menu folder name. Start Menu folder name does not relate to Desktop shortcuts.

Regards,
Galapo.

Re: Shorcut Behaviour and syntax...again
« Reply #2 on: May 18, 2011, 06:01:45 AM »

niche99

  • Diner
  • Jr. Chef
  • *
  • Date Registered: Apr 2011
  • Posts: 36
Hi,

Thanks for explaining and moving this topic to the appropriate section of the forum.
An example of crazy WB syntax. Can the API be modified to provide consistent behaviour or is the underlying function hardcoded?

This is my take on syntax and function behaviour:
Since each statement uses the word Add_Shortcut, I would expect consistent behaviour for the syntax of all shortcuts not just one particular case of making a shortcut. If syntax and function behaviour is consistent, syntax use becomes intuitive.
If I had a function called Add_Fruit, I would expect it to add apples, oranges and bananas in a consistently similar manner (putting the fruit in a box if demanded and wrapping it first if demanded then putting in a box) and not treat bananas as a special case and only put them in a box regardless of whether I want them wrapped.

Oh well.
Thanks for your help Galapo, always useful and informative.

Regards,
niche99
« Last Edit: May 18, 2011, 06:17:59 AM by niche99 »

Re: Shorcut Behaviour and syntax...again
« Reply #3 on: May 18, 2011, 11:59:45 AM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 1957
The second paramater is explicitly called 'StartMenuFolder' to indicate that it is reserved for Start Menu folder. Until now, no one has wanted to use this for shortcut creation under a sub-folder on the desktop. If this is desired, feel free to modify the code to suit, post back here, and we'll add the function to CAPI.

Regards,
Galapo.

 

Powered by EzPortal