2017-12-04 9 views
0

プログラムでフォルダを開き、このフォルダを削除するためのテキストを表示したいが、それを動作させることはできない。どんな助けもありがとうございます。スクリプトエディタを開いて、それを削除する質問

on opening folder theResponse 
    tell application "Finder" 
    set theName to name of theResponse 
    activate 
    display alert "Attention!" message "The folder" & theName & " was opened." 
    set question to display dialog "Do you want to delete this folder?" buttons {"No", "Yes"} default button "No" 
    set answer to button returned of question 
    if answer is equal to "Yes" then 
    set sourceFolder to theName 
    move sourceFolder to the trash 
     end tell 
    end opening folder 

答えて

0

theNameフォルダ名です - 文字列 - たとえばPicturesMoviesため。あなたは

set sourceFolder to theName 

とは、変更、削除theResponse

あるフォルダ(Finderの指定子またはエイリアス)への参照が必要

move theResponse to the trash 
関連する問題