I created the following script a while ago on my computer and now when I open it the code has changed - does anyone know why it does this? It’s very annoying:
property pdf_archive : alias "Jobs for Preflighting:Press Archive:"
on open thefiles
repeat with thisfile in thefiles
tell application "Finder"
set pathname to thisfile as alias
set the_file_name to thisfile as string
set pub_date to word -5 of the_file_name & "-" & word -6 of the_file_name
if «class cfol» named pub_date in «class cfol» pdf_archive exists then
move thisfile to «class cfol» pub_date of «class cfol» pdf_archive given «class alrp»:yes
else
set pub_date_folder to make «class cfol» in «class cfol» pdf_archive
set name of pub_date_folder to pub_date
move thisfile to «class cfol» pub_date of «class cfol» pdf_archive given «class alrp»:yes
end if
end tell
end repeat
end open
Commenting out the first line (since that alias doesn’t exist for me), I get this after compiling:
--property pdf_archive : alias "Jobs for Preflighting:Press Archive:"
on open thefiles
repeat with thisfile in thefiles
tell application "Finder"
set pathname to thisfile as alias
set the_file_name to thisfile as string
set pub_date to word -5 of the_file_name & "-" & word -6 of the_file_name
if folder named pub_date in folder pdf_archive exists then
move thisfile to folder pub_date of folder pdf_archive replacing yes
else
set pub_date_folder to make folder in folder pdf_archive
set name of pub_date_folder to pub_date
move thisfile to folder pub_date of folder pdf_archive replacing yes
end if
end tell
end repeat
end open
As far as my limited knowledge can take me, things like «class cfol» are what the Script Editor translates from when compiling (the raw syntax), and is replaced on-screen with the human-readable form, which it gets from the appropriate application’s applescript dictionary (i.e. the Finder, used in your script).
Thanks for your reply - deleting all the AppleScript plist files from my user library seems to have fixed it