You are not logged in.
Pages:: 1
Hello, friends.
Often I use the writeToFile: method like here:
set theArchiveData to webFrame's dataSource()'s webArchive()'s |data|()
theArchiveData's writeToFile:thePath atomically:true
-- the next code line
As I understand, the AppleScript interpretator continue with next code line. That is, doesn't wait for writing completion. So, how to make it to wait?
Last edited by KniazidisR (2022-06-27 06:02:12 am)
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
That call shouldn't return until the write is complete.
Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com
Offline
Thanks for the clarification.
I have one script that uses a repeat loop with this method inside it. After about 50-400 iterations, the script hangs.
I assumed that the reason for the hang is in this method, but as you explained to me, now I understand that the reason is something else.
Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB
Offline
I thought they were depricating this for writeToURL
As I was going to suggest that.
But they haven’t :
https://developer.apple.com/documentati … ritetofile
You’ll notice that it returns a BOOL value to let
You know if the save worked.
You might want to add that to your code,
You’ll know when it completed and if it was
Successful.
Offline
Pages:: 1