bsmith96 / Qlab-Scripts

Applescripts for Qlab 4. A variety of complex scripts and simple hotkeys to automate repetetive tasks.
MIT License
9 stars 2 forks source link

Regenerate when cues/files already exist #11

Closed bsmith96 closed 3 years ago

bsmith96 commented 3 years ago

If the group already exists, delete it before running. If the files already exist in the folder, delete them except the sub file before running.

bsmith96 commented 3 years ago
on checkForCue()
    tell application "Qlab 4"
        set groupCueAlready to ""
        try
            set groupCueAlready to (first cue of mainCueList whose q name is "Line Check")
        end try

        if groupCueAlready is not "" then
            delete groupCueAlready
        end if
    end tell

end checkForCue

on checkForFiles()
    tell application "Finder"
        set startingFolderContents to (entire contents of variableForPath)
        if startingFolderContents is not {theSubFile} then
            repeat for eachItem in startingFolderContents
                if eachItem is not {theSubFile} then
                    delete eachItem
                end if
            end repeat
        end if
    end tell
end checkForFiles