נראה לי ש - @אביי יוכל לעזור פה
י
יעקב מ. פינס
@יעקב מ. פינס
-
יצירת טבלה חכמה -
תוכנת סינון ללינוקס אובונטו קיים?@מד
אני אכן מודע לכך, תודה על הדאגה
אתה מכיר תוכנה כלשהיא? -
בעיה בקוד apple script למקבוק@יעקב-מ-פינס
רק משתף,
באמצעות Gemini נוצר הקוד הזהset pagesFilePath to POSIX path of (choose file with prompt "בחר קובץ Pages להמרה:") set saveFolderPath to POSIX path of (choose folder with prompt "בחר תיקיית יעד לשמירת קובץ ה-DOCX:") try set srcFile to POSIX file pagesFilePath as alias -- יצירת שם קובץ היעד set fileName to name of (info for srcFile) if fileName ends with ".pages" then set docName to text 1 thru -7 of fileName else set docName to fileName end if set dstPathString to saveFolderPath & docName & ".docx" -- אין צורך להפוך את זה לאובייקט POSIX file כאן אם נשתמש רק במחרוזת ב-shell -- set dstFile to POSIX file dstPathString -- וודא שהקובץ לא קיים כבר בנתיב היעד כדי למנוע בלבול -- נשתמש בפקודת shell לבדיקת קיום ומחיקה (עמידה מאוד) -- Check if file exists using 'test -f' set fileExists to (do shell script "test -f " & quoted form of dstPathString & " && echo true || echo false") as boolean if fileExists then do shell script "rm " & quoted form of dstPathString -- מחיקת הקובץ delay 0.1 -- המתן מעט שהמחיקה תתבצע end if -- הפעל את Pages וודא שהוא רץ tell application "Pages" activate -- המתן בסבלנות ש-Pages יהיה "מוכן" repeat 10 times -- נסה 10 פעמים עם השהייה של שנייה אחת delay 1 try -- נסה פקודה פשוטה כדי לבדוק תגובתיות set appVersion to version of it exit repeat on error -- עדיין לא מגיב, נמשיך לחכות end try end repeat if not (it is running) then error "Pages application could not be launched or is not responding." end if -- פתיחת המסמך set theDoc to open srcFile -- המתן עד שהמסמך ייפתח ויהיה פעיל repeat 20 times -- נסה 20 פעמים עם השהייה של 0.25 שניה (סה"כ 5 שניות) delay 0.25 try if exists theDoc then exit repeat on error -- המסמך עדיין לא נטען, אולי חלון לא מול end try end repeat if not (exists theDoc) then error "Failed to open Pages document within expected time." end if -- ייצוא המסמך (כאן עדיין נשתמש ב-POSIX file אובייקט כי Pages מצפה לו) export theDoc to (POSIX file dstPathString) as Microsoft Word -- סגור את המסמך המקורי close theDoc saving no end tell -- בדיקה סופית: וודא שהקובץ נוצר באמצעות פקודת shell set fileExists to (do shell script "test -f " & quoted form of dstPathString & " && echo true || echo false") as boolean if fileExists then display dialog "הקובץ נשמר בהצלחה כ-DOCX בנתיב: " & dstPathString with title "המרת Pages ל-DOCX" buttons {"אישור"} default button "אישור" return "OK" else error "ההמרה הסתיימה ללא שגיאה, אך קובץ ה-DOCX לא נמצא בנתיב: " & dstPathString end if on error errMsg number errNum display dialog "שגיאה: " & errMsg & " (קוד שגיאה: " & errNum & ")" with title "שגיאת המרה" buttons {"אישור"} default button "אישור" return "Error: " & errMsg end try
שנבדק ב Script Editor ועבד בהצלחה
-
העלאת NodeBB לשרת חינמיזה בעצם שרת שיושב על דיסק קשיח??