Jump to content

AppleScript calls old version of script


Recommended Posts

I'm probably missing something very basic here but I can figure out what. I have this AppleScript in Alfred

on main(notetext)
	tell script "jemDT"
		create_entry(the current date, notetext)
	end tell 
end main

on alfred_script(q)
  main(q)
end alfred_script

 

Unfortunately it seems like it's calling a cached (?) version of create_entry. If I make changes to what create_entry does, it doesn't show up when I call this script. But if I put this slightly modified script in Script Editor and try

on main(notetext)
	tell script "jemDT"
		create_entry(the current date, notetext)
	end tell
end main

on alfred_script(q)
	main(q)
end alfred_script

alfred_script("Hello")

Then everything works as expected. So to me it seems like Alfred uses a cached version of jemDT or something like that. Any suggestions for how I can get Alfred to use the current version of jemDT?

Link to comment

Try replacing NSAppleScript with a regular Run Script with Language = /usr/bin/osascript (AS).

 

NSAppleScript has some really weird behaviour, and it's generally a bad idea to use it because it runs on Alfred's main thread and therefore blocks Alfred.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...