I have a folder of external files indexed in DT 3.5.2
many of the files do not show a preview
Mainly .applescript files. DT lists the Kind: Text OSA Script and has a character count.
I have moved the indexed file to the database and still no preview.
Maybe I answered my own question…
It appears as though the applescript file must compile to show a preview.
something i had not checked yet.
If an app is not available as in tell app adobe then no preview?
So is DT decompiling to get the text for scpt?
This apparently happens when it indexes the files?
Exporting text from filemaker…
But still have a problem with some files, but they DO compile fine.
The same result if I rewrite them with ScriptDebugger or script editor.
This fails to preview
set MyDatabase to current application's NSArray's arrayWithArray:{{|name|:"Spot", hair:"Black", Height:{|feet|:1, |inches|:2, totalInches:14}, weight:43}, {xxx:"xx"}}
and this fails to preview
set TheDate to TheMatch's |date| as date
But if its commented out it does preview
--set MyDatabase to current application's NSArray's arrayWithArray:{{|name|:"Spot", hair:"Black", Height:{|feet|:1, |inches|:2, totalInches:14}, weight:43}, {xxx:"xx"}}
this also previews
set MyDatabase to current application's NSArray's arrayWithArray:{{}}
Also, if I change the file extension to txt they preview fine!
I need them in applescript files so ScriptDebugger can use them as clippings, without trying to keep them up to date.
BUT I was thinking about using a Markdown wrapper to view them with prism so I get syntax highlighting. I am aware the builtin prism does include applescript.
Is anyone else using DT for applescript source code?
There is more to this story…
I have a external folder indexed.
It shows previews on applescript, scpt and scptd files.
DT allows changing the text of any of these files and then saves it.
I changed a scptd file, just a comment to see what happened.
It saved with the same file extension and the date changed.
When I opened the file with ScriptDebugger it said the file extension was wrong.
The file SD was opening still had the .scptd extension.
I saved the file as a .applescript file from SD to the same directory.
It did not show in the DT indexed files.
I deleted both files from DT, then resaved to the same directory.
DT would not show the files again even after “update index files”
I did not expect to be able to edit the scpt or scptd files but maybe the applescript files since its just text.
Now I know to NOT change anything other than .applescript files.
I am glad DT3 shows a preview of all script files, even script.app files which makes it great for searching code. Especially being able to copy the text directly from them.
I have a suspicion what may be happening here but @cgrunenberg would have to confirm or deny my theory.
Perhaps .applescript files like you’ve constructed here are being treated as Markdown and the first line is parsed as MultiMarkdown metadata.
On further investigation…
Indexing 4000 scripts it happens (blank view/edit pane) on all types.
It tries to launch the target applications from the scripts as they are indexed.
Hi @georgeorwell, on the Script Debugger forum a user has published a AppleScriptObjC database in 2017 which I tried to open with his FileMaker runtime app but it crashes after start.
I’ve now downloaded a FileMaker demo and started to export as HTML manually (to access the database’s contents after the demo expired). Is exporting the current view scriptable?
I have done that… and rebuilt my own db in FileMaker.
The file ASObj-C Database.fmpur should be able to be opened with Filemaker 14+, and maybe its a problem with the current version 19 but I know it works in FM18.
You wont be able to change the database structure or modify the security etc, that was stripped out with the making of a runtime.
BUT you can “Export Records” data from each layout. If you use Filemaker as the type it will have all the field names just as the original was. You will have to export the other 3 or 4 layouts as well. If you have the Filemaker demo you can then rebuild the relations from file to file.
But if you are not familiar with FileMaker it could take you awhile to figure it all out. I have thousands of hours over 25 years of experience with FM so its simple to me.
You should however be able to get at the raw data fairly quickly.
Basically you will create a new calc field and concatenate many fields together in one text field then export that single field as a file.
You can also simply go record by record choose Send Sample to “Script Debugger” from the menu.
But that is not ALL of the data that is there.
I’ve done that, even filtered for each class. Took some time but worked out well via UI scripting the export dialog.
Unfortunately it doesn’t seem to be possible to send samples to Script Debugger with the FileMaker demo. When I try I get an error window saying “Either the front window is not a samples window or the script failed to recognize the window was a samples window.”
So it would be really great if you post them on the Script Debugger forum
Forgot to ask: Is there other ASObjC documentation you would recommend? I have Xcode and Dash, but is there more?