applescript/xcode 中的数据库
所以我在 youtube 上观看了这个视频 (http://www.youtube.com/watch?v=l_PLHuhlAJU )关于如何创建数据库。我很喜欢这个主意,但我无法让它发挥作用。
任何人都可以帮助我
P.S 你也可以告诉我如何使用 xcode 来做到这一点:-)
so I watched this video on youtube (http://www.youtube.com/watch?v=l_PLHuhlAJU) on how to make a database. I rellay like the idea but I cant get it to work.
can anyone help me
P.S you can also tell me how to do this with xcode :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了扩展 Anne 的评论,这里有一个更简单、更高效的数据库。在脚本的顶部创建数据库。您只需在数据库中添加和删除记录即可。其余代码仅搜索数据库并显示结果。
请注意,数据库中的一条记录如下所示,您只需在扩展数据库时添加和删除记录即可。
{personName:"Sam Price", memberNumber:"1", 电话号码:"123"}
Just to expand on Anne's comments, here's a much easier and more efficient database. At the top of the script you create your database. You just add and remove records from the database there. The rest of the code just searches the database and shows the results.
Note that one record in the database looks like this, and you just add and remove records as you expand your database.
{personName:"Sam Price", memberNumber:"1", phoneNumber:"123"}
该视频讨论的脚本粘贴在视频评论中。它无法正常工作,因为所有换行符都被 Youtube 删除了。我更改了代码以按预期工作。将下面提到的代码复制到AppleScript编辑器并点击运行,它现在应该可以正常工作了。
请注意,这不是数据库。该脚本仅获取您的输入并将其与一些预定义的值进行一一比较。当机器出现时,它会显示一个对话框。
注:
这段代码非常难看。您最好学习使用循环和列表。这使您的代码更加高效。
The script discussed by this video is pasted in the video comment. It's not working properly because all new line characters are removed by Youtube. I changed the code to work as intended. Copy the code mentioned below to AppleScript Editor and hit run, it should work properly now.
Please note this is NO database. This script only gets your input and compares it one-by-one with some pre-defined values. When a mach occurs, it shows a dialog.
Note:
This code is very ugly. You better learn using loops and lists. This makes your code much more efficient.