开发者

Get file name using drag-and-drop

Hi I have written applescript to get file name.

on open of thisPDF

set fName to thisPDF as string
(*
-
-
my code comes here.
-
-
*)

end open

When i drop any file on my application's icon. This code help me to get the file name in fName variable but this gives me the path of that file like

"MacHD:Users:my Name:Desktop:file Name"

But what I want is only f开发者_如何学Goile Name.

How to do this?


Give this a try:

set file_name to name of (info for alias "Macintosh HD:path:to:file.txt")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜