The routine to identify the path to that program folder -- and, consequently, to the items included within it -- works just fine in the standalone using my default macOS Snow Leopard, in macOS Sierra, and in the Windows version.
However, my Mac beta-testers are reporting that my app warns that none of the items included in the program folder are available. (At least one tester reports running macOS Mojave.) Has something changed in how we identify the folder containing the standalone?
Here's one handler -- called from preOpenStack -- that worked previously to identify the path to the audiofile folder:
Code: Select all
on doStoreAudioPath -- UPDATED WITH SPANISH WARNING
local tStackPath -- full path to the stack
-- get stack folder
put the effective filename of stack "EAS_SABE" into tStackPath
set the itemDelimiter to slash
if the platform = "MacOS" and the environment = "standalone application" then
-- if this is a standalone application running on a Mac, find the path to the .app file
repeat until last item of tStackPath contains ".app"
delete last item of tStackPath
end repeat
end if
-- remove last item to get the path to the containing folder
delete last item of tStackPath
set the cFolderPath of stack "EAS_SABE" to tStackPath
-- create and store path to audiofile folder
put tStackPath & slash & "EAS_Audiofiles" into tAudioPath
-- confirm that the Audiofile folder exists
if there is a folder tAudioPath then -- folder exists
set the cAudioPath of stack "EAS_SABE" to tAudioPath
else -- folder cannot be found, so warn in both english and spanish
switch
case the cVersion of stack "EAS_SABE" = "EAS"
answer warning "Audiofile folder cannot be found."
break
case the cVersion of stack "EAS_SABE" = "SABE"
answer warning "No se encuentra el directorio de las grabaciones auditivas."
break
end switch
set the cAudioPath of stack "EAS_SABE" to empty
end if
end doStoreAudioPath
Please correct me, so I can inform my very patient beta-testers.
Thanks. jeff k