Thursday, October 23, 2014

#1 2012-11-29 07:06:45 am

rienq
Member
Registered: 2012-11-29
Posts: 6

Restore corrupted AppleScript script

Hi all

Can anybody help me out.
I always backup my stuff. But not this time, not this time that I worked a very long day on the improvement of my script.
And my mac crashed when I was in the middle of a version that would not save because I was halfway coding a new part in the script.
Now when I want to open the script (.scpt) AppleScript acts as if it will open, but then immediately crashes.
That is only the case with this script file. Other script open just fine.
I can open the file with a text editor, but that looks weird and is some machine code weird row of all kinds of characters and here and the a variable name.
In that it looks the same as any other AppleScript script that I open with a text editor.

Does anyone know of a way to restore or retrieve as much information from the file as possible ?

Thanks
Rienk

Mac book pro
OS X 10.7.5

Please do not start the "you should have backed up" thing.
I know. I just know and it hurts. Let's see if something can be done. Otherwise I'll start over...

Model: MacBookPro
Browser: Safari 534.57.2
Operating System: Mac OS X (10.7)


Filed under: corrupt script file

Offline

 

#2 2012-11-29 07:23:23 am

McUsrII
Member
Registered: 2012-11-20
Posts: 2351
Website

Re: Restore corrupted AppleScript script

I am sorry for you.

Try downloading a 20 day evaluation copy of Script Debugger. Maybe it can restore it for you. Maybe

Last edited by McUsrII (2012-11-29 07:23:44 am)


Filed under: script debugger

Offline

 

#3 2012-11-29 07:37:11 am

regulus6633
Member
From: Taulov, Denmark
Registered: 2006-11-01
Posts: 1695
Website

Re: Restore corrupted AppleScript script

You can try the command line tool osadecompile. It might work. If it does it will give you the text of the script.

Applescript:

set f to choose file
do shell script "osadecompile " & quoted form of POSIX path of f

Offline

 

#4 2012-11-29 08:10:00 am

McUsrII
Member
Registered: 2012-11-20
Posts: 2351
Website

Re: Restore corrupted AppleScript script

And if everything else fails, you can try xxd from the commandline, but then you'll have to copy and paste, and reassemble your script. Enter man xxd in a Terminal window.


Filed under: Scripts, corrupted, xxd

Offline

 

#5 2012-11-29 04:01:29 pm

rienq
Member
Registered: 2012-11-29
Posts: 6

Re: Restore corrupted AppleScript script

regulus6633,

You made my day! the osadecompile worked!
No idea what it did, but it did what it had to do.
Thank you so much!

And thanks to McUsril, too. I didn't tried your solution, because regulus' solution worked, but I appreciate your input.

Happy scripting from now on.
(and backing up... right now, of course)

best
rienq

Offline

 

#6 2012-11-29 04:05:10 pm

regulus6633
Member
From: Taulov, Denmark
Registered: 2006-11-01
Posts: 1695
Website

Re: Restore corrupted AppleScript script

Very nice rienq. Glad it worked and happy scripting! cool

Offline

 

#7 2012-11-29 04:29:35 pm

McUsrII
Member
Registered: 2012-11-20
Posts: 2351
Website

Re: Restore corrupted AppleScript script

Glad it worked for you, I learned something new as well. smile

The trick is, is to put all the stuff you don't care about in a TimeMachine backup quarantine, marking them, so they aren't included, so those backups, doesn't take that long!

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.040 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)