Ask user for folder?
fvidania
Global Mapper UserTrusted User
Hi,
I'm creating a script to import all the csv and dxf from a folder. But I want the user to select the folder to import. Is that possible?
In other words, is it possible to "ask questions" to the user? or the script just run what's in the code without questions?
Thanks
I'm creating a script to import all the csv and dxf from a folder. But I want the user to select the folder to import. Is that possible?
In other words, is it possible to "ask questions" to the user? or the script just run what's in the code without questions?
Thanks
Comments
-
You can use the DEFINE_VAR command with PROMPT=DIR.
(There is an example in the entry mentioned. I can't give my own example because I haven't used this function myself yet.) -
Hello fdivania,
As tjhb says, the DEFINE_VAR script command sounds like what you're looking for. You use DEFINE_VAR to define variables that can be used in the current script, and DEFINE_VAR with the PROMPT=DIR parameter allows the user to select a folder, which is captured in the variable you're defining. You can then use that variable in subsequent commands in your script.
best regards,
~Jeff -
Thank you to both of you. That's what I was looking for. For some reason in the link I'm using as guide, it doesn't show that option. It might be an old link or something.
Global Mapper Scripting Reference
Thanks, -
Yep, that's the guide for Global Mapper v13. A bit dated (not sure what you're running). Evidently the prompt stuff came in later.
Cheers,
~Jeff
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website