Hello,
The Automator workflow described at Add a simple ”Touch” Service to your context menu (Right-Click Menu) in MacOS X (Tested in Mac OS X 10.10.5, but should work in older and newer versions as well) with Automator.app · GitHub
is not functioning on my Sequoia 15.5 Mac. It does not update the selected Finder item (file or folder) to the current date/time when selecting the described workflow from the Services menu. .
The following script also is not modifying the selected file’s or folder’s date/time stamp. Nothing happens to the selected file or folder
How to fix either one?
on open these_items
repeat with i from 1 to the count of these_items
set this_item to (item i of these_items)
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else
process_item(this_item)
end if
end repeat
end open
-- this sub-routine processes folders
on process_folder(this_folder)
do shell script "touch \"" & POSIX path of this_folder & "\""
set these_items to list folder this_folder without invisibles
repeat with i from 1 to the count of these_items
set this_item to alias ((this_folder as text) & ¬
(item i of these_items))
set the item_info to info for this_item
if folder of the item_info is true then
process_folder(this_item)
else
process_item(this_item)
end if
end repeat
end process_folder
-- this sub-routine processes files
on process_item(this_item)
do shell script "touch \"" & POSIX path of this_item & "\""
end process_item