How do I get a folder path with the FileSystem folder picker action?

Not favoritedFavorited Favorited 0 favourites
  • 6 posts
From the Asset Store
HSV RGB Color Picker and Converter for Construct 3
  • + Mouse: On any click
    -> FileSystem: Show folder picker tag "setSource" mode Read-only (ID "", start in (default))
    -> System: Wait for previous actions to complete
    -> System: Set source to FileSystem.FolderPath
    -> debug: Set text to source
    

    Filesystem.FolderPath returns an empty string.

    I've also tried using the expression in a seperate event with "On picker complete" instead of using wait for previous action to complete, same result. The action runs, since it overwrites whatever was in the variable/text previously. Also tried using the list contents action and completed trigger after picking the folder, but same result.

    Preview on chrom/win10. dropbox.com/scl/fi/hgtsq5dfcsjrm2b1l3314/filesystemtest.c3p

  • This works for me:

    + Mouse: On any click
    -> FileSystem: Show folder picker tag "setSource" mode Read-only (ID "", start in (default))
    
    + FileSystem: On picker "setSource" complete
    -> System: Set source to "Source " &FileSystem.FolderNameAt(0)
    -> debug: Set text to source
    
    
  • Sure, the folder name works fine. I was wanting the path.

  • sorry to bump an oldish thread but I'm also getting an empty string. any solutions for this?

  • The FolderPath expression just repeats the Folder path parameter of file operations like Write text file in triggers like On file operation complete. You can get the name of the chosen folder after a folder picker completes using the FolderNameAt(0) expression. (I realized this purpose was not documented, so I updated the manual entry to cover that.)

    You cannot get the full file path to the folder (C:\Users\username\Documents\somefolder). For privacy reasons browsers do not expose such paths, as it can leak personal details like your username. Besides even if you could get that full path, you can't do anything with it in the File System plugin, as it never uses full paths. You can only work starting from picked folders, or known folders or desktop, only ever knowing the relative path from that folder.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • what if I don't have it for the browser, but for the desktop? How can I create a txt file in the root folder of the project?

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)