Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Script to Text.applescript - Simplified Suggestion #9

Closed
Wintercypher opened this issue May 23, 2018 · 1 comment
Closed

Convert Script to Text.applescript - Simplified Suggestion #9

Wintercypher opened this issue May 23, 2018 · 1 comment

Comments

@Wintercypher
Copy link

Hi,

I came across your script while searching for a solution. Your script inspired me to simplify the process while also being able to maintain git history. As a thank you for the inspiration, I have included the code below.

tell application "Script Editor"
	set doc to open inputFile
	save doc as "text" in inputFile
	tell application "Finder" to set name extension of inputFile to "applescript"
	close front window
end tell

This method uses Finder to change the extension of the file which removes the need to move the original file to the trash. This reduces the run time by 20%. I would also suggest putting an extension filter so that only .scpt files are edited.

Chip

@abbeycode
Copy link
Owner

That's a cool idea. I think the reason I don't overwrite the original is that I often keep the compiled script around. Thanks for making the suggestion, and hopefully people who want to accomplish the same will find this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants