10000 Fix export via JSON on macOS · steeltrack/AbletonOSC@ebc671f · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Fix export via JSON on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ideoforms committed Dec 31, 2023
1 parent 93e1f79 commit ebc671f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions abletonosc/song.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import tempfile
import Live
import json
Expand Down Expand Up @@ -194,6 +195,13 @@ def song_export_structure(params):
"tracks": tracks
}

if sys.platform == "darwin":
#--------------------------------------------------------------------------------
# On macOS, TMPDIR by default points to a process-specific directory.
# We want to use a global temp dir (typically, tmp) so that other processes
# know where to find this output .json, so unset TMPDIR.
#--------------------------------------------------------------------------------
os.environ["TMPDIR"] = ""
fd = open(os.path.join(tempfile.gettempdir(), "abletonosc-song-structure.json"), "w")
json.dump(song, fd)
fd.close()
Expand Down

0 comments on commit ebc671f

Please sign in to comment.
0