Since I started using Yosemite when I enable folder actions it takes up a huge amount of the CPU’s power. Sometimes more than 50%. This slows the computer down for me.
I have this script
on adding folder items to thisFolder after receiving theseItems
-- theseItems is a list of one or more items
set thisItem to item 1 of theseItems
-- thisItem is an alias reference to a dropped item
tell application "Finder"
set fileName to name of thisItem
end tell
set tids to AppleScript's text item delimiters
set AppleScript's text item delimiters to "."
set tempList to text items 1 through -2 of fileName
set end of tempList to "txt"
set newName to tempList as text
set AppleScript's text item delimiters to tids
-- from here use newName for your text file. I'm guessing that you could paste it into the save window text field or maybe you can use the Save command? I don't know.
-- to paste, use 'set the clipboard to newName'
-- then with System Events ui scripting 'keystroke "v" using command down'
-- focus needs to be in the text field
tell application "Finder"
set filePath to thisItem as string
end tell
tell application "ABBYY FineReader Express"
activate
end tell
delay 2
tell application "System Events"
tell process "ABBYY FineReader Express"
click button "Convert" of window "ABBYY FineReader Express"
say "scanning"
say "completed"
set value of text field "Save As:" to "Peter"
click button "Save" of front window
end tell
end tell
end adding folder items to
and this script
on adding folder items to thisFolder after receiving theseItems
set thisItem to item 1 of theseItems
tell application "System Events"
set theExtension to name extension of thisItem
end tell
if theExtension is "jpg" then
tell application "Finder"
move thisItem to "Hard disc:Users:peter:Desktop:processed descriptions"
end tell
return
end if
say "moving text file"
end adding folder items to
activating. Can anyone suggest what might be wrong with them and causing this huge use of CPU power?
Model: iMac
AppleScript: 2.6.1
Browser: Safari 537.85.10
Operating System: Mac OS X (10.8)