[Ham-Mac] Help with filename for AppleScript Autostart

Richard Kriss aa5vu at att.net
Fri Jan 29 17:59:31 EST 2016


I want to extend a big THANK YOU to Pete, KB3WTB, for a super rewrite of the OS X AppleScript to autostart both fldigi and  flrig. The script works perfect and I no longer have to worry about version number changes in fldigi or flrig.

TNX ANG to Pete KB3WTB

73 Dick AA5VU


> On Jan 29, 2016, at 3:31 PM, Pete Golian <pjgolian at gmail.com> wrote:
> 
> If the previous script works for you… here is a cleaner version of the script.  Basically, I moved the redundant parts of the script into subroutine called findAndStartApp.  The first two lines call that method:  once for fldigi and another for flrig.
> 
> All the lines below go into just one applescript file:

findAndStartApp("fldigi")
findAndStartApp("flrig")

on findAndStartApp(appName)
	-- assume apps are in the Applications Folder
	set thePath to path to applications folder
	tell application "System Events"
		set filelist to every file of thePath whose name starts with appName
		if filelist is not {} then
			-- if there are multiple apps found, use the last one in the list
			set theapp to last item of filelist
			do shell script "open -a " & name of theapp
		else
			-- no files found
		end if
	end tell
end findAndStartApp


More information about the Ham-Mac mailing list