Ask file "selected filter" expression.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Ask file "selected filter" expression.
So after some hours of searching around forum and google i decided to make a thread here.
The simple thing i want to do is just change file name extension depending on selected file filter (.exe, .zip, etc) while saving it with ask dialog script.
However, have stuck here for a while, so any help will be appreciated.
The simple thing i want to do is just change file name extension depending on selected file filter (.exe, .zip, etc) while saving it with ask dialog script.
However, have stuck here for a while, so any help will be appreciated.
Re: Ask file "selected filter" expression.
Hi boqsc,
sorry, don't understand what you are looking for!?
Best
Klaus
sorry, don't understand what you are looking for!?
Best
Klaus
Re: Ask file "selected filter" expression.
On WindowsThe file type will be pre-populated with Skript script (*.sk) and you can choose to change to JPEG (*.jpg) or zip (*.zip)
You can put other pairs of "type,*.ext" filters as you see fit. Default filename is optional.
Code: Select all
ask file "What to save?:" with "My_File_Default_Name" with filter "Skript script,*.sk,JPEG,*.jpg,zip,*.zip"
You can put other pairs of "type,*.ext" filters as you see fit. Default filename is optional.
Re: Ask file "selected filter" expression.
No problem. It's mainly my fault.Klaus wrote:Hi boqsc,
sorry, don't understand what you are looking for!?
Best
Klaus
Well i done it already before this thread:SparkOut wrote:On WindowsThe file type will be pre-populated with Skript script (*.sk) and you can choose to change to JPEG (*.jpg) or zip (*.zip)Code: Select all
ask file "What to save?:" with "My_File_Default_Name" with filter "Skript script,*.sk,JPEG,*.jpg,zip,*.zip"
You can put other pairs of "type,*.ext" filters as you see fit. Default filename is optional.
Code: Select all
on mouseDown
end mouseDown
on menuPick theitem
If theItem is "New script" then
If field "Code Field" is not empty then
answer "Script is not save. Do you want to save it?" with "No" or "Yes"
end if
end if
If theItem is "Open script" then
answer file "Please choose script that will be loaded..." with type "Skript Script|sk" or type "Text File|txt"
end if
If theItem is "Save As..." then
ask file "Please choose a directory, where the script will be saved..." with "Script.sk" with type "Skript Script|sk" or type "Text File|txt"
if the result is not "cancel" then
if it ends with "sk" then
open file it for write -- creates a file for Revolution to write to
write Field "Code Field" to file it
close file it
end if
end if
end if
end menuPick
Any ideas on how to change the output file extension using "Save as type"?
Later. when i have some more time - i make some pictures, that will make everything brighter, cause, for me it's hard to explain it in english language.
Re: Ask file "selected filter" expression.
Ah, you want the filename to populate with "script.sk" and if the user changes the file extension type to "text (*.txt)" then you want the filename to change to "script.txt" right?
As far as I know, this is impossible.
As far as I know, this is impossible.
Re: Ask file "selected filter" expression.
Exactly! Too bad but i think the same... Is it even possible to see any way to do this in the future?SparkOut wrote:Ah, you want the filename to populate with "script.sk" and if the user changes the file extension type to "text (*.txt)" then you want the filename to change to "script.txt" right?
As far as I know, this is impossible.
Re: Ask file "selected filter" expression.
Posted in wrong thread. Sorry.
Bidge
Bidge