a Simple Script to test if the File is already open, if not Open the File
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
on run set thisFunnelFile to (choose file of type "Numbers") tell application "Numbers" launch activate set tmpList to name of every document --set file_name to name of (info for alias "Macintosh HD:path:to:file.txt") set tmpdata to name of (info for thisFunnelFile) if tmpList does not contain tmpdata then -- set editDoc to (open thisFunnelFile) --> targetDoc contains a name reference to the opened document. open thisFunnelFile --else --set editDoc to thisFunnelFile end if end tell end run |