Hi Everyone,
I am trying to make a script that is used by folder actions and calls an ffmpeg shell command. So I have a folder called “MPEG” on my desktop. When a file is dragged into that folder, I want the script to run. I am then trying to pull the filename and extension into the script which are then used in the shell commands to do the file transcode. So let’s say I have a file called “Socks.mpg”. I want to plug in the name and extension to the script, then issue the shell command which transcodes the file, names it the same thing as the name variable, but adds a different extension.
So what’s my problem? I have the script configured on a folder, but nothing happens when I drag a file in. How can I see what the problem is? Also, when I originally tested this shell command (which works perfectly in /bin/sh and /bin/bash, I get an I/O error in the applescript log telling me that means the file is corrupted. but the same file works fine directly in terminal!). Can anyone shed some light on this? Here’s my script:
on adding folder items to this_folder after receiving added_items
repeat with i in added_items
set {Nm, Ex} to {name, name extension} of (info for i)
do shell script "/Users/vtaccess/ffmpeg/ffmpeg -i " & Nm & Ex & "-vcodec mpeg4 -sameq -acodec aac -ab 448 -ar 480000 -f mp4 " & Nm & ".mp4"
end repeat
end adding folder items to
I am very new at applescript, so I really appreciate any help in advance. Thanks,
j