I have a script that produces a list of RTF files for a given folder and fills a pull down:
on loadFileList()
--Load the list of files from the folder
log "file List"
tell application "Finder"
-- need to make this only find RTF files
set filePath to ((POSIX file defaultFilePath) as alias)
set fileList to ((name of every file whose name contains ".RTF") of folder filePath as list)
end tell
--load the file list into the popup menu
tell window "SelectWindow"
--log "Item List"
delete every menu item of menu of popup button "SelectFilePop"
repeat with tmpItem in fileList
make new menu item at the end of menu items of menu of popup button "SelectFilePop" with properties {name:tmpItem, title:tmpItem, enabled:true}
end repeat
end tell
end loadFileList
While this works, it would be prettier if the list didn’t have the file extensions. Does anyone know of a quick way to do this??
dee
Model: MacBook Pro 17
AppleScript: XCode 2.4.1
Browser: Safari 419.3
Operating System: Mac OS X (10.4)