Page 1 of 1

Help switching from revCopyFile for sandboxing

Posted: Tue Jan 29, 2013 6:08 pm
by doobox
Hi there,

I could use a little shove in the right direction, in order to update this small snippet of code from my app, so it can be sandboxed.

Code: Select all

on exportRow pPath
   set the title of this stack to "Choose Export Folder"
   answer folder "Please choose a folder:" with specialfolderpath("desktop")
   set the title of this stack to "Dictaphone"
   put it into tUserFolderChoice
   if tUserFolderChoice is empty then
      exit exportRow
   else
      revCopyFile pPath,tUserFolderChoice -- this is what the sandbox does not like i beleive
      play audioClip tm_notif_10.wav
   end if
end exportRow
I am not even sure i can do this.
When the user clicks an icon on any of the rows in my data grid, it runs the exportRow handler, and copies the .wav file from the app folder, to the users chosen location.
I have the entitlement for read write access to user selected files.
But would this cover, what i am doing..?
I can read and write in my app folder without entitlement right..?
So I want to write to the folder the user selected(i should be ok there)..from a folder(my app folder) where i dont need entitlement.
Any way im getting all at crossed purposes. The main first obstacle is that revCopyFile uses apples finder script and is definitely whats throwing errors in the console monitoring "sandboxd" at the moment.

Kind regards
Gary

Re: Help switching from revCopyFile for sandboxing

Posted: Tue Jan 29, 2013 7:31 pm
by Klaus
Hi Gary,

...
put url("binfile:" & tOriginalFile) into url("binfile:" & tNewFilePath)
...
Just supply valid filenames for tOriginalFile and tNewFilePath :D


Best

Klaus