Dictionary terms conflicts

Issue #15 resolved
Andrey repo owner created an issue

'script' class vs application constant/property, 'scripting additions' vs application property.

'bundle theFile' error

tell application id "com.latenightsw.ScriptDebugger6" -- Script Debugger.app
        tell document 1
                if script type is not in {script application, bundled compiled script} then
                        -- it's not a bundle; show error dialog or whatever
                        error number -128
                end if
                        set theResult to compile document 1 without showing errors
                        if not theResult then
                                -- it didn't compile; show error dialog or whatever
                                error number -128
                        end if
                set usedLibs to used script libraries
                set libCount to count of usedLibs
                if libCount is 0 then -- no libs, nothing to do
                        beep
                        error number -128
                end if
                set theFile to file spec
                set embeddedLibs to embedded script libraries
                set usedLibFiles to used script library files
        end tell
end tell
try
        set libsFolder to path to resource "Script Libraries" in bundle theFile
on error -- we need to make lib folder
        set resFolder to ((theFile as text) & "Contents:Resources:") as alias
        tell application "Finder"
                set libsFolder to make new folder at resFolder with properties {name:"Script Libraries"}
        end tell
end try
repeat with i from 1 to libCount
        if embeddedLibs does not contain item i of usedLibs then -- check it's not already embedded
                tell application "Finder"
                        duplicate item i of usedLibFiles to libsFolder with replacing
                end tell
        end if
end repeat

Comments (2)

  1. Log in to comment