've written a little Applescript that writes to a file’s .plist file, launches the app, and quits.
the problem I have is that the AppleScript doesn’t seem to quit, and so the menubar doesn’t seem to appear on the app it is launching (it appears if the app is launched normally). It seems the AppleScript isn’t giving hand to the app.
Any help would be greatly appreciated, I’m barely beginning here…
here’s the code:
on run {}
set this_story to "<dict>
<key>SplashOrNot</key>
<string>NO</string>
<key>LanguageOfChoice</key>
<string>Francais</string>
<key>CardNumber</key>
<string>Reticulaires</string>
<key>NavigationOrNot</key>
<string>NO</string>
</dict>
</plist>"
set this_file to (((path to preferences folder) as text) & "diff.plist")
my write_to_file(this_story, this_file, false)
try
tell application "diff2"
run
end tell
end try
end run
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file