ok, i have the tool working fine, but not as i would like it to.
heres where it doesnt work as i'd like and i dont know if we can do a work around for it.
This particular tool finds an already downloaded file.
for example.
v0_road.shp
(each one of the .shp files relates to some form of terrain, ie roads/crops/coast etc)
but in order for the tool to work it needs to take the file extension (.shp) off.
This is why i made the scrollable list.
point the tool at the folder with the file in and then select the name of the file without the .shp from that list.
However on looking at it, that wont work because it not actually selecting the .shp file.
i can select the v0_road.shp file and then manually remove the .shp extention and the tool will run fine.
Is there a way to select the file and then have the program remove the .shp before running the tool?
secondly.
if there is not a folder tWorkFolder then
create folder tWorkFolder
end if
what i meant was, when the tool extracts the information from the .shp file i need the application to create another folder within the file destination folder.
ie. again the same example extracting v0_road to e:\terragear\work
the program should create a folder within terragear\work called v0_road and extract the data into that.
does that make sense?
this is my script so far
Code: Select all
on mouseUp
local tShellCommand
if field "linewidthfld" is not empty then
put "--line-width" & space & field "linewidthfld" into tlinewidthfld
end if
if field "pointwidthfld" is not empty then
put "--point-width" & field "pointwidthfld" into tpointwidthfld
end if
if field "maxsegfld" is not empty then
put "--max-segment" & space & field "maxsegfld" into tmaxsegfld
end if
if field "startrecfld" is not empty then
put "--start-record" & field "startrecfld" into tstartrecfld
end if
if field "areafld" is not empty then
put "areafld" into tareafld
end if
if field "shapefilefolderfld" is not empty then
put field "shapefilefolderfld" into tshapefilefolderfld
end if
if field"workfolderfld" is not empty then
put field "workfolderfld" into tworkfolderfld
end if
--put space & quote & quote into tShellCommand
--the above line puts an empty pair of quotes to be the
--first parameter passed to the shell command which is
--necessary to act as the dummy console window "title"
--if setHideConsoleWindows is true
--so you will need to uncomment the line when you do that.
put space & "shape-decode" & space after tShellCommand
put space & tlinewidthfld & space after tShellCommand
put space & tpointwidthfld & space after tshellcommand
put "--continue-on-errors" after tshellcommand
put space & tmaxsegfld after tShellCommand
put space & tstartrecfld after tshellcommand
put space & tshapefilefolderfld after tshellcommand
put space & tworkfolderfld after tshellcommand
put space & tareafld after tshellcommand
answer "About to:" && quote & "start" & tShellCommand & quote
get shell ("start" & tShellCommand)
end mouseUp