1
我创建简单的脚本来使用shell脚本转换mp3文件。我决定使用applescript自动化我的转换。 基本上我在做的是选择mp3文件,然后使用我的命令行分割该文件,我想创建一个文件夹所在的位置(脚本将为我创建)。AppleScript中选择文件的文件夹路径
现在我只需要弄清楚如何获取文件的文件夹路径。 如何在applescript中执行此操作?
这里是脚本,我到目前为止有:
set mp3FileToSplit to choose file without invisibles
set thepath to mp3FileToSplit as text
set theposix to POSIX path of thepath
tell application "Finder" to set file_name to (name of mp3FileToSplit)
do shell script "/opt/local/bin/mp3splt -t 3.00 -d " & quoted form of file_name & " " & quoted form of theposix
现在什么脚本确实是在我的硬盘驱动器的根目录创建文件夹,我需要的是该文件所在的文件夹中。
任何帮助将不胜感激。