property escapedChars : "!$&\"'*()/{[|;<>?` \\" & ":@#%+" # the second set was added by CK
on escape_string(the_string)
set chars to every character of the_string
repeat with i from 1 to length of chars
if escapedChars contains (item i of chars as text) then
set item i of chars to "\\" & (item i of chars as text)
end if
end repeat
return every item of chars as string
end escape_string
# with thanks to http://techierambles.blogspot.com/2009/04/applescript-to-automatically-replace.html
# function for cleaning the characters from the file name
--anything in disallowedChars will be removed altogether
--this takes the precedence over replacedChars
property disallowedChars : ""
--set the list of characters you want to replace
--replacedChars will be replaced with the replacementChar
--in this case, an underscore
property replacedChars : "^
"
--set the character you'd like to use to replace the invalid
--characters specified in replacedChars
property replacementCharacter : "_"
on CleanName(theName)
set newName to ""
repeat with i from 1 to length of theName
--check if the character is in disallowedChars
--remove it completely if it is
if ((character i of theName) is in disallowedChars) then
set newName to newName & ""
--check if the character is in replacedChars
--replace it with the replacementCharacter if it is
else if ((character i of theName) is in replacedChars) then
set newName to newName & replacementCharacter
--if the character is not in either replacedChars or
--disallowedChars, keep it in the file name
else
set newName to newName & character i of theName
end if
end repeat
return newName
end CleanName
# get the parent path of the script
on MyParentPath()
tell application "Finder"
POSIX path of (container of (path to me) as text)
end tell
end MyParentPath
#CK: Exports a recording using Turbo.264
on export_with_turbo_264(input_file, output_file)
write_log("Exporting with Turbo.264 is deprecated. Please uncomment this function to use it.")
end export_with_turbo_264
tell application "App Store" to activate
tell application "System Events"
tell process "App Store"
-- click text field 1 of group 1 of splitter group 1 of window 1
tell window 1
click text field 1 of group 1 of splitter group 1
key code 48
-- set value of UI element 1 of group 1 of splitter group 1 to "boo"
end tell
-- properties of text field 1 of group 1 of splitter group 1 of window 1
end tell
end tell
on adding folder items to this_folder after receiving these_items
tell application "Finder"
if not (exists folder "converted" of this_folder) then
make new folder at this_folder with properties {name:"converted"}