AppleScript to control Logic Pro? loading samples from a folder
AppleScript to control Logic Pro? loading samples from a folder
- Subject: AppleScript to control Logic Pro? loading samples from a folder
- From: Esa Ruoho <email@hidden>
- Date: Sun, 28 Apr 2013 17:26:10 +0300
How would I simulate a drag'n'drop from a folder to Logic Pro's Media Bin (used to load wavefiles to the currently open song)?
So far I've gotten a Smart Folder action going, that detects changes to a folder, and then uses Apple Script to launch and activate Logic, then tries to get Logic to load them. Instead, what happens is that Logic tries to load a completely new and empty song, and loads the sample onto that. This song has no template and doesn't use any kind of environment. I'm trying to get it to be so that when new samples are added to the LogicSmartFolder -location, Logic loads them to the current song's Media Bin.
Here's what I have thus far:
on run {input, parameters}
if application "Logic Pro" = running then
tell application "Logic Pro" to activate
else
tell application "Logic Pro" to launch
end if
tell application "Finder"
set theFiles to {input}
-- set theFiles to (get selection) -- get the selected items
open theFiles using POSIX file "/Applications/Logic Pro.app"
end tell
tell application "System Events"
tell process "Logic Pro" to keystroke "n" using command and control down -- New Instrument
tell process "Logic Pro" to keystroke "6"
tell process "Logic Pro" to key code 36
end tell
return input
end
The Input is receiving information from the Smart Folder.I'm trying to make CMD-ctrl-N open the "create new" audiotracks and create 6 and press enter to have them in. This was just one try to find out if I could at least somehow prepare the Logic song so that it has space for the samples. Obviously, I would need to figure out a way of reading amount of files in the smartfolder, and have that specify how many audiotracks are loaded. Ideally I'll keep crafting this until I can get the wavefiles to be loaded in directly to the audiotracks in the arrangement view. that would be absolutely stupendous.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden