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
Howdy, Stranger!
Categories
- 12.3K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 789 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 522 Other Discussion
- 126 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 100 Global Mapper Forum Website