Kindle My Clippings file. Comparing present file & old file.

Hello,
Looking for some help as I am stumped. Any help is appreciated.
A bit of an explanation of what I am trying to achieve. On the kindle there is a file called *My Clippings.txt*. This has a list of anything that has been highlighted by me. I want to put things I have highlighted into a flashcard program so I thought I'd employ hazel.
In a directory called "Google rive", (Changed the directory from Google Drive to eliminate that as a possible cause of the problem.), there are 3 files. My Clippings.txt, My Clippingsold.txt, My Clippingschanges.
When the kindle is plugged in hazel does the following.
1) Deletes the old "My Clippingsold.txt"
2) Rename "My Clippings.txt" to "My Clippingsold".txt
3) Delete "My Clippingschanges.txt"
4) Copies the "My Clippings.txt" file from the kindle to my Google rive directory.
5) Runs a shell script to compare "My Clippingsold.txt" and "My Clippings.txt" and outputs the difference in files as "My Clippingschanges.txt"
The "My Clippingschanges.txt" file is then used to make up the flashcards for my latest highlights.
When hazel is left to do its work the changes file has a size of 0 bytes. The "My Clippings.txt" file and "My Clippingsold.txt" have the same contents.
I am baffled as to why. I have enabled verbose scripting and it looks like the rules are run sequentially.
When I go through 1 step at a time, copying the apple script from my actions into the applescript editor I get the results I expect.
My rule is if "My Clippings.txt" and Kind is text then run 5 actions.
These actions are:
Run the following applescript. (I changed my name to PC in the following)
1) Delete the old "My Clippingsold.txt" file.
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippingsold.txt") as alias
delete thatFile
end tell
2) Rename "My Clippings.txt" to "My Clippingsold,txt"
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippings.txt") as alias
set name of thatFile to "My Clippingsold.txt"
end tell
3) Delete the "My Clippingschanges.txt" file.
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippingschanges.txt") as alias
delete thatFile
end tell
4) Copy the file from the kindle with the option "rename the file" set.
5) Run the shell command for the difference between the files.
diff -i -w -B "/Users/PC/Google rive/My Clippings.txt" "/Users/PC/Google rive/My Clippingsold.txt" > "/Users/PC/Google rive/My Clippingschanges.txt"
I am open to any suggestions to get what I want done. I like hazel and can see myself using it for more and more things so I am using this as a learning curve and am very curious as to what I am doing wrong.
Any suggestions?
Looking for some help as I am stumped. Any help is appreciated.
A bit of an explanation of what I am trying to achieve. On the kindle there is a file called *My Clippings.txt*. This has a list of anything that has been highlighted by me. I want to put things I have highlighted into a flashcard program so I thought I'd employ hazel.
In a directory called "Google rive", (Changed the directory from Google Drive to eliminate that as a possible cause of the problem.), there are 3 files. My Clippings.txt, My Clippingsold.txt, My Clippingschanges.
When the kindle is plugged in hazel does the following.
1) Deletes the old "My Clippingsold.txt"
2) Rename "My Clippings.txt" to "My Clippingsold".txt
3) Delete "My Clippingschanges.txt"
4) Copies the "My Clippings.txt" file from the kindle to my Google rive directory.
5) Runs a shell script to compare "My Clippingsold.txt" and "My Clippings.txt" and outputs the difference in files as "My Clippingschanges.txt"
The "My Clippingschanges.txt" file is then used to make up the flashcards for my latest highlights.
When hazel is left to do its work the changes file has a size of 0 bytes. The "My Clippings.txt" file and "My Clippingsold.txt" have the same contents.
I am baffled as to why. I have enabled verbose scripting and it looks like the rules are run sequentially.
When I go through 1 step at a time, copying the apple script from my actions into the applescript editor I get the results I expect.
My rule is if "My Clippings.txt" and Kind is text then run 5 actions.
These actions are:
Run the following applescript. (I changed my name to PC in the following)
1) Delete the old "My Clippingsold.txt" file.
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippingsold.txt") as alias
delete thatFile
end tell
2) Rename "My Clippings.txt" to "My Clippingsold,txt"
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippings.txt") as alias
set name of thatFile to "My Clippingsold.txt"
end tell
3) Delete the "My Clippingschanges.txt" file.
tell application "Finder"
set thatFile to ("Macintosh HD:Users:PC:Google rive:My Clippingschanges.txt") as alias
delete thatFile
end tell
4) Copy the file from the kindle with the option "rename the file" set.
5) Run the shell command for the difference between the files.
diff -i -w -B "/Users/PC/Google rive/My Clippings.txt" "/Users/PC/Google rive/My Clippingsold.txt" > "/Users/PC/Google rive/My Clippingschanges.txt"
I am open to any suggestions to get what I want done. I like hazel and can see myself using it for more and more things so I am using this as a learning curve and am very curious as to what I am doing wrong.
Any suggestions?
