I wrote a script of AppleScript with TextWrangler to open some perl’s script files inside one document. The script will open some files that have extentions ‘.pl’ and ‘.pm’ in a folder you select. Every file in some nested folders is target.
You don’t need to drop the same folder since second time, only click the applet. The applet remembers the folder you dropped.
Before making the below script run, you may should check and rewrite bounds data of window in the fourth line from the bottom of script to adjust to your monitor.
property jobFolder : null
on open ARGV
set jobFolder to item 1 of ARGV as alias
run of me
end open
on run
if jobFolder is null then
set jobFolder to choose folder with prompt "Select a folder including some perl’s script files."
end if
set targetFiles to {}
getScriptFiles(jobFolder, a reference to targetFiles) of me
openTextWranglerWindow(targetFiles) of me
end run
on getScriptFiles(jobFolder, targetFiles_ref)
tell application "Finder"
set scriptFiles to every item of jobFolder ¬
whose ((name of it) ends with ".pm") or ((name of it) ends with ".pl")
end tell
repeat with a_file in scriptFiles
set contents of targetFiles_ref to contents of targetFiles_ref & (a_file as alias) as list
end repeat
set innerFolders to {}
tell application "Finder" to set innerFolders to every item of jobFolder whose (class of it) is folder
if innerFolders is not {} then
repeat with f in innerFolders
getScriptFiles(f, targetFiles_ref) of me
end repeat
end if
end getScriptFiles
on openTextWranglerWindow(targetFiles)
tell application "TextWrangler"
activate
open targetFiles opening in new_window with properties {bounds:{0, 20, 800, 1000}}
set show documents drawer of text window 1 to true
end tell
end openTextWranglerWindow