Wondering if anybody can offer some insight or point me in the right direction on my first Studio project.
I have an existing AS droplet that I am trying to adapt(as a Studio Droplet)
to replace a value passed with a dropdown menu built with a third-party OSAX.
The dialog is a simple window with the pull-down and two buttons: “cancel” and “process”. The values in the pulldown are populated dynamically then passed to rest of the script.
Questions:
1)I’ve got the dialog to appear/work in a regular app, and it appears during build/run, but I can’t quite grasp how to call it after I “drop” my folders onto the app. I’ve tried the “load nib” etc, but no luck. I’ve also tried a few other things gathered from the board with no success. If I remove the need for the input from the pulldown, my original AS code works fine when placed within the “on open names” handler.
2)From what I can tell so far, I need to stick all of my orignal code within the “on clicked theObject” handler for the process button. This just doesn’t seem right to me.
Hoping someone can “open my eyes”
below is the code without my “processing” of items:
on idle
(* Add any idle time processing here. *)
end idle
on open names
(* Add your script to process the names here. *)
-- Remove the following line if you want the application to stay open.
quit
end open
on will open theObject
tell application "Finder"
set the_settings_folder to alias ((path to "sdat") & ("Settings:") as string)
set myList to get (name of every file of the_settings_folder whose name ends with ".trc") as list
end tell
tell menu of popup button "theButton" of window "theWindow"
try
delete every menu item
end try
repeat with tempItem in myList
make new menu item at end of menu items with properties {name:tempItem, title:tempItem, enabled:true}
end repeat
end tell
end will open
on choose menu item theObject
set theSetting to (name of current menu item of theObject)
end choose menu item
on clicked theObject
tell window "theWindow"
set theSetting to (name of current menu item of popup button "theButton")
end tell
if name of theObject is "processButton" then
close window "theWindow"
--does my orignal code all have to go in here?---------
display dialog theSetting
-------------------
quit
end if
if name of theObject is "cancelButton" then
quit
end if
end clicked