Xojo Scripts and relative files.

  1. 7 weeks ago

    Sam R

    Jul 29 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan

    Is there a way with IDE scripting, to get the path of the XojoScript file that's being executed?

    I want to use an external script to import files into the built application, however I only have the relative path from the XojoScript file to those files.

    I can get the path to the project; to the built application, but I don't see how to get the path to the actual script, these scripts are designed to work with file syncing services, so I can't hard code the paths to any of the files that the script will import.

    Ideas?

  2. Norman P

    Jul 29 Pre-Release Testers, Xojo Pro great-white-software.com/blog

    Do you mean a build script Sam ?
    If so theres nothing in the context for that that would tell you the scripts path

  3. Sam R

    Jul 29 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan

    @Norman P Do you mean a build script Sam ?
    If so theres nothing in the context for that that would tell you the scripts path

    Yeah; that's what I mean.

    Dang; I'll have to think some more. The other thing I'm thinking is to get the user to select to set where the Xojo project is; then create the relative paths from there.

    I'd kinda like a fool proof system for this. In the past I'd hard code the paths, so it didn't matter where the script or the files were compared to the project. However I also want to make this easily transportable, so relative links are a must.

or Sign Up to reply!