How can I escape a bang ('!') in a path for my menu script?

You have encountered a problem using Far macros? Here you can get help.
Post Reply
chrisloughnane
Posts: 2
Joined: Sun 23 May, 2021 20:14

How can I escape a bang ('!') in a path for my menu script?

Post by chrisloughnane »

I am trying to add a script that will open folder A on LHS and folder B on RHS.

To access it I hit F2 and select my script which works.

Example :Yahoo!:
  1. lua: if PPanel.Left then Keys("Tab") end
  2.  
  3. lua: Panel.SetPath(0, [[\\192.168.253.211\media\A]])
  4.  
  5. lua: Panel.SetPath(1, [[\\192.168.253.211\media\B]])
but if my path has ! at the start of a folder name it fails.

Example :bang:
  1. lua: if PPanel.Left then Keys("Tab") end
  2.  
  3. lua: Panel.SetPath(0, [[\\192.168.253.211\media\A\!Read]])
  4.  
  5. lua: Panel.SetPath(1, [[\\192.168.253.211\media\B\!To Read]])
How can I delimit the ! in lua for my real path?
Last edited by HaRT on Wed 21 Sep, 2022 23:54, edited 1 time in total.
Reason: Fixed the Topic Title
User avatar
HaRT
Moderator
Posts: 11064
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 236 times
Been thanked: 373 times

How can I delimit ! in a path for my menu script?

Post by HaRT »

chrisloughnane wrote: Wed 21 Sep, 2022 21:45 How can I delimit the ! in lua for my real path?
I assume you mean “escape” rather than “delimit”. It's not Lua that makes the difference, it's the User Menu, ! is a special character there. I encourage you to read the built-in Help on this (press F1 while the menu is open and then activate the (very first) Special symbols hypertext link by hitting Enter).
Фар есть инструмент, а не нянька. © 2009 DrKnS
chrisloughnane
Posts: 2
Joined: Sun 23 May, 2021 20:14

How can I delimit ! in a path for my menu script?

Post by chrisloughnane »

HaRT wrote: Wed 21 Sep, 2022 22:00 I assume you mean “escape” rather than “delimit”
I did mean escape but couldn't find the edit option. :facepalm2:

Perfect. Thank you very much HaRT. I found my answer, I was unaware of the built-in help with F1 and everything is working now! :grin:
Post Reply

Return to “Support and Troubleshooting”