Applescript 无法计算子文件夹中的文件数
我似乎根本无法让它发挥作用。如果有人能提供帮助或照亮它,那就太好了?
谢谢
on adding folder items to thisFolder after receiving thisItem
try
-- This gives you the name of the route folder, and the name of the added folder
set folderName to name of (info for thisFolder)
set itemName to name of (info for thisItem)
-- I am trying to find out how many items the new folder that has been added to the route folder has but none of the variables below work
-- Example: Route Folder > New Folder > # of files in new folder?
set the numberOfFiles to the number of items in itemName
set fileCount to (count (info for thisItem))
set the item_count to the number of items in thisItem
-- Dialog box to show information
set the alert_message to (the folderName as text) & return & (the itemName as text) & return & (the item_count as text) as Unicode text
display dialog the alert_message
end try
end adding folder items to
I cant seem to get this to work at all. Would be great if anyone could help or shine some light on it?
Thanks
on adding folder items to thisFolder after receiving thisItem
try
-- This gives you the name of the route folder, and the name of the added folder
set folderName to name of (info for thisFolder)
set itemName to name of (info for thisItem)
-- I am trying to find out how many items the new folder that has been added to the route folder has but none of the variables below work
-- Example: Route Folder > New Folder > # of files in new folder?
set the numberOfFiles to the number of items in itemName
set fileCount to (count (info for thisItem))
set the item_count to the number of items in thisItem
-- Dialog box to show information
set the alert_message to (the folderName as text) & return & (the itemName as text) & return & (the item_count as text) as Unicode text
display dialog the alert_message
end try
end adding folder items to
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果 thisItem 是您添加的文件夹,请执行以下操作...
if thisItem is a folder that you added do this...