Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

isUserName((”Robert” ) as an if test

Featured Replies

I need some help in using the isUserName((”Robert” ) test. Some of the lines of code may be wrapped.)I’m using WPI to upgrade Filzellia FTP program on my wife’s and my machines.

I have the following 3 lines of code in WPI that work:

{JSCRIPT}=if(isUserName("Robert")) {JSCRIPT}=alert("conditional Test message-the user is Robert")

{JSCRIPT}=if(!isUserName("Rita")) {JSCRIPT}=alert("conditional Test message-user is not Rita")
When the %USERNAME% =“Robert”

{FILECOPY} "%wpipath%Install\internet\Filezilla_stuff\sitemanager.xml" "%USERPROFILE%\AppData\Roaming\FileZilla\sitemanager.xml"

These 2 lines fail:
There are 2 files in the Filezilla_stuff folder; sitemanager.xml and RITAsitemanager.xml.  The files contain different FTP sites:

{JSCRIPT}=if(isUserName("Robert")) {FILECOPY} "%wpipath%Install\internet\Filezilla_ stuff\sitemanager.xml" "%USERPROFILE%\AppData\Roaming\FileZilla\sitemanager.xml"

{JSCRIPT}=if(isUserName("Rita")) {FILECOPY} "%wpipath%Install\internet\Filezilla_stuff\RITAsitemanager.xml" " %USERPROFILE%\AppData\Roaming\FileZilla\sitemanager.xml"

However when I attempt to select which “sitemanager.xlm” file to copy (depending upon the %USERNAME%, both lines fail with returned code 999.

 

   Monday, February 16, 2015 2:58:49 PM - cmd2 Success (returned code undefined): if(isUserName("Robert")) alert("conditional Test message-the user is Robert")

   Monday, February 16, 2015 2:58:51 PM - cmd3 Success (returned code undefined): if(!isUserName("Rita")) alert("conditional Test message-user is not Rita")

   Monday, February 16, 2015 2:58:54 PM - cmd5 Success (returned code 0): CMD /C COPY /Y "O:\Install\internet\Filezilla_stuff\sitemanager.xml" "C:\Users\Robert\AppData\Roaming\FileZilla\sitemanager.xml"

   Monday, February 16, 2015 2:58:54 PM - cmd6 *** Fail *** (returned code 999): !isUserName("Rita") {FILECOPY} "O:\Install\internet\Filezilla_stuff\RITAsitemanager.xml" " C:\Users\Robert\AppData\Roaming\FileZilla\RITAsitemanager.xml"

I’m hoping that someone can supply me with the correct contax.

Thanks, Bob

  • 2 weeks later...
  • Author

I was able to solve the problem myself.  Here is the code that works.

 

{JSCRIPT}=if (isUserName("Rita")) RunCmd('cmd /c copy /y "%wpipath%Install\internet\Filezilla_stuff\RITAsitemanager.xml" "%USERPROFILE%\AppData\Roaming\FileZilla\sitemanager.xml"',false,true)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.