Qu before I buy Xojo

99% of my Xojo apps run from Applescripts. I am really good at Applescripts. Someone on the Xojo forum helped me code Xojo so when you click a button, an Applescript does its thing.

I just want to make sure before I buy Xojo for $99, that when I build an app, that the Applescripts will somehow get incorporated into the app and still run like it does when I do a test run. I will be making apps and using them at work and need to know that things will perform the way I expect on that computer, the way its on my computer. Thanks.

I read somewhere in this Forum that you can embed AppleScript into a Xojo App.
And Xojo does support Apple Events: http://documentation.xojo.com/index.php/AppleEvent :slight_smile:

That is why the IDE version of XOJO is free… write you code, test it… if it works then buy a license

[quote=216468:@Shawn Brady]99% of my Xojo apps run from Applescripts. I am really good at Applescripts. Someone on the Xojo forum helped me code Xojo so when you click a button, an Applescript does its thing.

I just want to make sure before I buy Xojo for $99, that when I build an app, that the Applescripts will somehow get incorporated into the app and still run like it does when I do a test run. I will be making apps and using them at work and need to know that things will perform the way I expect on that computer, the way its on my computer. Thanks.[/quote]

I don’t quite understand. You say that 99% of your Xojo apps run on AppleScript, and then wonder if it will work if you buy. It should work just as well in the trial version and in the commercial one.

Maybe you should go on experimenting with the techniques provided to you, make sure it works for you, and ask more questions about that if needed. The trial version run and the $99 one work identically.

[quote=216469:@Sascha S]I read somewhere in this Forum that you can embed AppleScript into a Xojo App.
And Xojo does support Apple Events: http://documentation.xojo.com/index.php/AppleEvent :)[/quote]

Indeed. A script can be dragged in the project, then called as a method with a return value.

If you are asking whether the scripts themselves are embedded in the Xojo application, and need not be present separately on the user’s machine, the answer is yes…

Thank you Peter. I’ll be a happy camper and a Xojo owner very shortly. Just push a button and a folder opens, pretty simple but so necessary in my job. Tired of clicking through 6 folders to get to where I want to be.

[quote=216499:@Shawn Brady]Thank you Peter. I’ll be a happy camper and a Xojo owner very shortly. Just push a button and a folder opens, pretty simple but so necessary in my job. Tired of clicking through 6 folders to get to where I want to be.

[/quote]

How about System shortcuts to folders?

Anyway xojo is more fun to do it…:wink:

derk, don’t know exactly what you mean but all my scripts open the folders I need, they are NOT system folders, they are files and folders on anyone of our servers, at least 10 servers so far.

FYI, you don’t need an Applescript for that.

dim f as new FolderItem( pathToFolder )
f.Launch

Applescript is only convenient when you need to talk to and control another app.

Ah that’s differend from what i thought.

Kem…you may have just rocked my world and I may just fall off, can’t wait to try your suggestion. But Applescript lets me place the open folder where I want. How can XOJO do that. Also, how do I open a file. do you want to see my Applescript.

also kem, how about mounting a server, how do you do that.

It could all be done with Xojo code, but AppleScript is more convenient for those additional functions. I’d probably use AppleScript too.

Did you know you can send parameter to your AppleScripts? Write the Run handler like this:

on run args
…
end run

args will be a list and you can send any string parameters you’d like. For example, you can supply the path of the folder you want to open and the position of the window. Drag that AppleScript into your project (lets say it’s named “OpenFolderAS”) and call it like:

dim r as result = OpenFolderAS( "/path/to/folder", 10, 10, 200, 400 )

args will hold {"/path/to/folder", 10, 10, 200, 400} in this case.

Another trick: You can create AppleScripts on the fly and call them directly through the shell with osascript. For example:

dim arr() as string

arr.Append "tell app ""Finder"""
arr.Append "open folder "Drive:Path:To:Folder"
arr.Append "end tell"

dim theAS as string = join( arr, EndOfLine )
theAS = theAS.ReplaceAll( "'", "'\\''" )
theAS = "'" + theAS + "'"

dim sh as new Shell
sh.Execute "/usr/bin/osascript " + theAS + " '/path/to/folder' 10 10 200 400"

This is just a simple example but hopefully you get the idea. The advantage of this technique is that you can store an AppleScript in a constant, perhaps with placeholders for certain parameters, then use that template was a base to customize the script.

I hope this gives you a few ideas.

Why use a shell?
Look at this thread Proper way to execute an AppleScript? about NSAppleScript declares.

bought XOJO and built 3 apps I created. Was happy to find out that my Applescripts get copied into the app so its portable. see attached. Right click on the app and choose ‘show package contents’, they are in a folder called resources.