Guys so you can get the whole story. Basically I'm trying to drop a "prefs.js" file into the directory that Firefox makes so that I can set settings for users. Here is my whole script so you can see what it does:
tell application "Finder"
try
tell application "Firefox"
activate --Opens Firefox to create prefs.js
end tell
end try
try
tell application "Finder"
set the visible of process "Firefox" to false --Tell's firefox to open minimized
end tell
end try
end tell
tell application "Firefox"
quit --Closes firefox
end tell
set FolderPath to ((path tohome folderasstring) & "Library:Application Support:Firefox:Profiles") as text --Sets the directory so ~/Library/Application\ Support/Firefox/Profiles/
set the_string to ""
tell application "Finder"
set myFolders to folders of folderFolderPath
repeat with this_item in myFolders
set the_string to the_string & (this_item as string) & return
end repeat
set the_string to items 1 thru -2 of the_string as string --Finds the randomly generated folder that is in the Profiles subfolder
end tell
set theFile to the_string & "prefs.js"
set JAMF to "Macintosh HD:Library:Application Support:JAMF:JamfCustomApps:prefs.js"
set JAMFNew to (POSIX path of JAMF)
tell application "Finder"
movefileJAMFtotheFile with replacing
end tell
The last step is the step to move the prefs.js file that will be dropped on the computer via a 3rd party application into the JamfCustomApps folder. Then copy that folder to the saved folder location from the previous step and overriding that file.