Sending App

Hi i’ve compiled an app, and I want too send it too a friend, but it doesn’t work when I send it too him. I’ve heard that applescripts do not work when compiled on 1 computer and sent too another because the properties do not remain the same or something. Is this true and is there a way to fix it?

Maybe thousands of reasons why your script doesn’t work in an other machine: code bad designed, platform incompatibility, data loss… Perhaps you should describe machines A and B, how did you save your script and how you did moved it to machine B, and expose the parts of your code you think could be problematic…

ok so I created an applescript which automatticly backs up my Documents folder to a server. That works fine. By the way, both these machines are iBook G4s. A friend wanted it, so i recompiled, without run only. I sent it onece over e-mail and once over AIM. Both failed to work. Then I recompiled them too Run Only. Did the same thing, e-mail and AIM. Both didn’t work. I don’t believe there is any problem within the script, I believe its the fact that my script is looking for my preferences on him comp or something. Any ideas how I can send this program over without him having too recompile it on his end if i send him the script?

If you store your prefs in an external file, you must pass this file to your friend. If you’re talking, though, about properties, these should travel stored in your script… Are you compressing the file before sending it? What if you try with a “display dialog x” test?

hmm ok good idea will try the test, and i’m not sure if i’m storing my prefs internally or externally…i’m guessing externally. Is there a universal place there stored. Somewhere in Application Support Folder? Thanks for the help by the way.

The universal place is the “Preferences” folder. You can access it using “do shell script” and the command-line utility “defaults” (see “man defaults” in a Terminal window), or saving your own home-made file to “path to preferences”.

OK so, I looked into the defaults thing and what you seem to be saying is that I should have a “do shell script” command in the applescript and your saying that I should make a script which matches all the persons defaults to my backup program? Also I looked into the other way and found a com.apple.applescript.plist in my Home Folder/ Preferences. Is that what your talking about?

Did you hard-code the paths to your documents folder and/or the server. That could be the cause of the problem. If that’s the case, can you modify your code to allow the user to choose the folder(s) to backup and the location to back them up to?

Just a thought,
Brad Bumgarner, CTA

yes I did but included is a script which does just that (allow the user too choose)! however those scripts won’t launch, and I’m trying too figure out why…thanks for your help anyway though. jj or anyone, any idea which Preference I need to send along or code?

If you post your code, I think it will be much more quicker, btw :rolleyes:

I can’t, already compiled it, run only :x I’m an idiot, and deleated the original script. Thats why I was so despertly wondering if it could be sent to others…any ideas?

Ok so I havn’t gotten any feed back for while, so I’m ganna try and simplfy this, could I compile RUN or NON RUN only an applescript then send it too another computer and have that person be able to open and run it?

You don’t say what you mean by “it doesn’t work”. If the file does not arrive intact, I’ve seen that happen - you should make a Disk Image using Disk Copy. When I try and Zip an Applescript and upload it, people downloading it get a very small file with nothing in it. I don’t know why this is.

If you mean the file arrives, but does not execute, tell us what error if any the friend is getting.

You can compile whatever and send it to another machine. If you save as standard applet, you create a carbon app with resource fork, wich is some time lost if you send the file via email or enclosed in a .tgz file, etc. So, you should package it using formats which support this resource-fork (as mentioned previously): dmg, sit, panther’s zip (requires panther in both machines).
You can’t open a run-only script. Actually, you lost such code, though the app will still be fully functional.

This may have nothing to do with your problem, but I encountered a similar problem when I emailed a script to my girlfriend. It was a simple thing to email her current ip address to me. Anyway, when I clicked on it nothing happened. My best guess was that it was a permission issue, and my solution was to open the application in script editor on her machine and resave it as an application. I don’t know why, but that fixed it.

Andy