Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

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.

Featured Replies

Had the need to find users desktop path so it could point back to a local version of a dashboard/ launch file if they were not using the hosted version, so that I don't have to try and fill the Manage External Files dialogue with the paths to each users individual desktops. That way I can then use my SM script to open a file in its default app...

This seems to work on all the machines I can find, but if anyone has improvements or finds it breaks then please chip in...


// DeskFolder()

// 2011/01/20 JR

// v1

// returns path to desktop



import javax.swing.filechooser.*



sep = System.getProperty("file.separator")

os = System.getProperty("os.name").toLowerCase().substring(0,3)

fsv = FileSystemView.getFileSystemView()

if (os == 'mac') {

	return fsv.getHomeDirectory().toString() + sep + 'Desktop' + sep

} else {

	return fsv.getHomeDirectory().toString() + sep

}

I just tested this on Windows Vista and it worked for me.

The only improvement I can think of is to not include all classes from javax.swing.filechooser, since you are only using one, and only using it once. This could be done two ways...

change

import javax.swing.filechooser.*

to

import javax.swing.filechooser.FileSystemView


- or -




change

fsv = FileSystemView.getFileSystemView()

to

fsv = javax.swing.filechooser.FileSystemView.getFileSystemView()

  • Author

Thanks Dan..

  • 7 months later...

Hi John,

... or just with System Properties

sep = System.getProperty("file.separator")

home = System.getProperty("user.dir") + sep

//  or System.getProperty("user.home") + sep

 

if ( System.getProperty("os.name").toLowerCase().substring(0,3) == 'mac') {

	return home + 'Desktop' + sep

} else {

	return home

}

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.